id: codeigniter-env

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

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: 4a0a00473045022029ee1df24e3b205804ca5b2bb5c1e54bfacd36b56d547eac30564adb954de06c022100b7b2d0659659ecdfb5d2425d86548fd01cfef445f20fcc10d28bf85bee9dbf35:922c64590222798bb761d5b6d8e72950