id: twitch-api-token

info:
  name: Twitch API Secret Token
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/twitch-api-token.go
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/twitch-api-token.yaml
  metadata:
    verified: true
    max-request: 1
  tags: twitch,exposure,tokens

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

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