OWASP Hunting

Config & design

JWT Vulnerabilities

JWT vulnerabilities include algorithm confusion, none algorithm bypass, weak secrets, and key injection attacks that allow token forgery.

Payloads are read from main at 35c1f2b (committed 22 Nov 2026). Project version 1.0.2.

These payloads are for authorized testing only: systems you own, authorized bug bounty programs, or controlled lab environments. Unauthorized testing is illegal.

Payload files

Folder on GitHub

Use the arrow keys to move between payloads. Press Enter or C to copy the focused payload.

jwt-vulnerabilities-payloads.txt

88 payloads · 8.3 KB
Source

Loading payloads for JWT Vulnerabilities…

What it is#

JWT (JSON Web Token) vulnerabilities occur when tokens are improperly implemented or validated. Common issues include accepting the none algorithm (no signature), algorithm confusion (switching RS256 to HS256 and signing with the public key), weak HMAC secrets susceptible to brute-force, and key injection via the JWK header parameter.

Attack vectors#

  • Authentication tokens in Authorization headers
  • Cookie-based JWT session management
  • API authentication
  • OAuth/OIDC access and ID tokens

Testing methodology#

  1. Decode the JWT (base64) and examine the header and payload
  2. Test alg: none by removing the signature and setting algorithm to none
  3. Test RS256 to HS256 confusion by signing the token with the server's public key as HMAC secret
  4. Brute-force the HMAC secret with jwt-cracker or hashcat
  5. Test for sensitive data exposure in unencrypted payload

Indicators of vulnerability#

  • Token with alg:none accepted by the server
  • Token signed with different algorithm than expected is accepted
  • Payload claims (role, admin) accepted from forged token

Detection guidance#

Enforce explicit algorithm allowlists in JWT verification. Never accept the none algorithm in production. Monitor for JWT decoding errors.

Mitigation and remediation#

  • Explicitly specify and enforce the expected algorithm in JWT validation
  • Never accept the none algorithm in production
  • Use a strong, randomly generated secret key (256+ bits for HMAC)
  • Validate all claims (exp, iss, aud) on the server
  • Disable JKU/JWK header parameter processing unless specifically required

References#

Responsible Use

All content in this reference is for authorized security testing only. Use only on systems you own or have explicit written permission to test.

  • Systems and applications you own
  • Authorized penetration testing engagements
  • Bug bounty programs with defined scope
  • Educational lab environments (DVWA, WebGoat, HackTheBox)