id: twitter-api-key

info:
  name: Twitter API Key
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/twitter-api-key.go
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/twitter-api-key.yaml
    - https://developer.twitter.com/en/docs/authentication/overview
  metadata:
    verified: true
    max-request: 1
  tags: twitter,exposure,tokens,vuln

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

    extractors:
      - type: regex
        part: body
        regex:
          - (?i)(?:twitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{25})(?:['|\"|\n|\r|\s|\x60|;]|$)
# digest: 4a0a0047304502203afc59bc7aa12da8af9f6c94ccae867ca9d05f271ad44f9634e13ebe9d35e8f60221008a972625576a20e4aa414e4d26c38138a26340cea2198ad664285fc484d1a4b9:922c64590222798bb761d5b6d8e72950