id: codeigniter-env

info:
  name: Codeigniter - .env File Discovery
  author: emenalf
  severity: high
  description: Codeigniter .env file was discovered.
  metadata:
    max-request: 12
  tags: config,exposure,codeigniter

http:
  - method: GET
    path:
      - "{{BaseURL}}{{paths}}"
    payloads:
      paths:
        - "/.env"
        - "/.env.dev.local"
        - "/.env.development.local"
        - "/.env.prod.local"
        - "/.env.production.local"
        - "/.env.local"
        - "/.env.example"
        - "/.env.stage"
        - "/.env.live"
        - "/.env_1"
        - "/.env.old"
        - "/.env_sample"

    matchers-condition: and
    matchers:
      - type: regex
        regex:
          - "(?m)^APP_(NAME|ENV|KEY|DEBUG|URL|PASSWORD)"
          - "(?m)^DB_(HOST|PASSWORD|DATABASE)"
        condition: or

      - type: status
        status:
          - 200
# digest: 4a0a004730450220550b87f91f5f948705229b625b425ecb6a45427bbdceefb45a996b45769ce7eb022100b60d20520c28596e8317528ac2e33ac9dba753e1c9774a7c29d2b1b74beda152:922c64590222798bb761d5b6d8e72950