id: github-oauth-access

info:
  name: GitHub OAuth Access Token
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/praetorian-inc/noseyparker/blob/main/crates/noseyparker/data/default/builtin/rules/github.yml
    - https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-authentication-to-github
    - https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps
    - https://github.blog/2021-04-05-behind-githubs-new-authentication-token-formats/
  classification:
    cwe-id: CWE-522,CWE-540
  metadata:
    verified: true
    max-request: 1
  tags: github,oauth,token,exposure,vuln

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

    extractors:
      - type: regex
        part: body
        regex:
          - '\b(gho_[a-zA-Z0-9]{36})\b'
# digest: 490a00463044022058859b2cb4d56ca157b954871e1709143d50b4cc9d252175c4313147d9d80941022028e55a6ef0a796f98343f02968ce301fae9a6d69ab54207fbb32e46d30225a86:922c64590222798bb761d5b6d8e72950