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,vuln

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