id: jwk-json-leak

info:
  name: JSON Web Key File - Exposure
  author: Mohsen Yaghoubi
  severity: info
  description: |
    Searches for JSON Web Key (JWK) file.
  reference:
    - https://portswigger.net/web-security/jwt/algorithm-confusion
  classification:
    cpe: cpe:2.3:a:jwt_project:jwt:*:*:*:*:*:*:*:*
    cwe-id: CWE-540
  metadata:
    verified: true
    max-request: 1
    vendor: jwt_project
    product: jwt
    shodan-query: html:"jwks.json"
  tags: exposure,token,generic,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/.well-known/jwks.json"
      - "{{BaseURL}}/.well-known/jwks"
      - "{{BaseURL}}/.well-known/openid-configuration/jwks.json"
      - "{{BaseURL}}/.well-known/openid-configuration/jwks"
      - "{{BaseURL}}/jwks.json"
      - "{{BaseURL}}/jwks"

    stop-at-first-match: true

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '"kty":'

      - type: word
        part: content_type
        words:
          - 'application/json'

      - type: status
        status:
          - 200
# digest: 4a0a00473045022100910139f36f138cdf289bc798b8d9b24b8a8a300f21db218591ad3b75448d68ad0220638d5593ca2d3211a9a29d179b4ab5fc8d2506620533e03a8b12cd85a57d227a:922c64590222798bb761d5b6d8e72950