id: huggingface-user-access-token

info:
  name: HuggingFace User Access Token
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/praetorian-inc/noseyparker/blob/main/crates/noseyparker/data/default/builtin/rules/huggingface.yml
    - https://huggingface.co/docs/hub/security-tokens
  classification:
    cwe-id: CWE-522,CWE-540
  metadata:
    verified: true
    max-request: 1
  tags: huggingface,exposure,tokens,vuln,ai

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

    extractors:
      - type: regex
        part: body
        regex:
          - '\b(hf_[a-zA-Z]{34})\b'
# digest: 4a0a00473045022100c885b61bd7fa883900fbbbe1df5dce97addbdeb9bc0b319caac6a0e29f6e2db3022002e35353b9cff69cf9bb85bb2bb8ebc6bd2369ff1d4ff4d4bbeb8b45a5897c85:922c64590222798bb761d5b6d8e72950