id: pypi-upload-token

info:
  name: PyPI Upload Token
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/praetorian-inc/noseyparker/blob/main/crates/noseyparker/data/default/builtin/rules/pypi.yml
    - https://github.com/pypa/warehouse/issues/6051
    - https://pypi.org/project/pypitoken/
  classification:
    cwe-id: CWE-540
  metadata:
    verified: true
    max-request: 1
  tags: pypi,token,exposure,vuln

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

    extractors:
      - type: regex
        part: body
        regex:
          - "(pypi-AgEIcHlwaS5vcmc[a-zA-Z0-9_-]{50,})"
# digest: 4a0a00473045022100bab102836acfb3fc9f93f16f39f09b4f5f9da7fff01fdf3a1e4636e7c431cde202200311a4ef0993c3d023948420d9e5067b71ffb9ae4ad84f4c93a427b078aef801:922c64590222798bb761d5b6d8e72950