id: particle-access-token

info:
  name: particle.io Access Token
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/praetorian-inc/noseyparker/blob/main/crates/noseyparker/data/default/builtin/rules/particle.io.yml
    - https://docs.particle.io/reference/cloud-apis/api/
  classification:
    cwe-id: CWE-522,CWE-540
  metadata:
    verified: true
    max-request: 1
  tags: particle,exposure,tokens,vuln

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

    extractors:
      - type: regex
        part: body
        regex:
          - 'https://api\.particle\.io/v1/[a-zA-Z0-9_\-\s/"\\?]*(?:access_token=|Authorization:\s*Bearer\s*)\b([a-zA-Z0-9]{40})\b'
          - '(?:access_token=|Authorization:\s*Bearer\s*)\b([a-zA-Z0-9]{40})\b[\s"\\]*https://api\.particle\.io/v1'
# digest: 4a0a00473045022009416000de34cad275ca6f33b78e2faad91ee09e0f94fd51c1f751159c33d474022100ce2eef3e4a1f77485710a4cc7d5160fb66878c4d5a2db19f074c5e219d22d6dd:922c64590222798bb761d5b6d8e72950