id: mailgun-api-token

info:
  name: Mailgun API Key
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/praetorian-inc/noseyparker/blob/main/crates/noseyparker/data/default/builtin/rules/mailgun.yml
    - https://documentation.mailgun.com/en/latest/api-intro.html#authentication-1
  classification:
    cwe-id: CWE-522,CWE-540
  metadata:
    verified: true
    max-request: 1
  tags: mailgun,token,exposure,vuln

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

    extractors:
      - type: regex
        part: body
        regex:
          - '(?i)(?:mailgun|mg).{0,20}key-([a-z0-9]{32})\b'
# digest: 4b0a00483046022100dc43edd498f8914715e80dd13e94cb95e9f159208ba5c8db1ff418f0f3e37330022100a31af32c680d6ba33e188e81a179eeb7bbd60a824cd80da6028b6bc5e95bf761:922c64590222798bb761d5b6d8e72950