id: react-app-password

info:
  name: React App Password
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/praetorian-inc/noseyparker/blob/main/crates/noseyparker/data/default/builtin/rules/react.yml
    - https://create-react-app.dev/docs/adding-custom-environment-variables/
    - https://stackoverflow.com/questions/48699820/how-do-i-hide-an-api-key-in-create-react-app
  metadata:
    verified: true
    max-request: 1
  tags: react,exposure,tokens

http:
  - method: GET
    path:
      - "{{BaseURL}}"

    extractors:
      - type: regex
        part: body
        regex:
          - \bREACT_APP(?:_[A-Z0-9]+)*_PASS(?:\s+WORD)?\s*=\s*['"]?([^\s'"$]{6,})(?:[\s'"$]|$)
# digest: 4a0a0047304502210097981cf0ec338722a7a4f3a67a40eaa06cd05d6838c35e1ebde042f6cf9fb85c022006c613afd99511efed5d32439618fc80c44592d1c12cc4f6cdd7f633d6b7b317:922c64590222798bb761d5b6d8e72950