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:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: jwt_project
    product: jwt
    shodan-query: html:"jwks.json"
  tags: exposure,token,generic

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: 4a0a0047304502201a1d32ad004dfa7d6a92547fe723d72d3b76dcb0248a6078247b088fc73ab105022100a21f1c08729b959dde43eac3876cbc3ac95e4fb635994e27a2e86494d0fd9280:922c64590222798bb761d5b6d8e72950