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

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: 490a00463044022067ccbd259d58f5f3b582119dd5b77a60db8af718baf8d04e0f936edcc9401dbe02207bc4025c018726a65883700c06110275e88f74e9e2abcf1515d973423a23747c:922c64590222798bb761d5b6d8e72950