appsec.fyi

JSON Web Tokens (JWT) Resources

Post Share

A curated AppSec resource library covering XSS, SQLi, SSRF, IDOR, RCE, XXE, OSINT, and more.

JSON Web Tokens (JWT)

JSON Web Tokens (JWTs) are a compact, URL-safe format for transmitting signed claims between parties, defined in RFC 7519. They consist of three Base64-encoded parts — header, payload, and signature — and are most commonly used for stateless authentication and session management in modern web and API applications. Their flexibility is also their biggest source of bugs.

JWT vulnerabilities typically come from flawed validation rather than from the spec itself. Servers that accept the "alg": "none" header skip signature verification entirely. Servers that accept multiple algorithms can be tricked into algorithm confusion attacks — for example, treating an RSA public key as an HMAC secret. The "kid" header has been a recurring source of SQL injection, path traversal, and arbitrary file read. Weak HMAC secrets fall to brute force in minutes with tools like jwt_tool. And even libraries that get the basics right have repeatedly shipped regressions that re-enable old attacks years later.

Storage and lifecycle introduce a second class of risk: tokens kept in localStorage are XSS-readable, refresh-token rotation is often skipped, and revocation is rarely implemented because JWTs are designed to be stateless. RFC 8725 ("JWT Best Current Practices") exists specifically because the original spec left too much room for unsafe defaults.

This page collects PortSwigger's JWT research and Web Security Academy labs, the major open-source testing tools (jwt_tool, jwt-pwn, jwtXploiter, c-jwt-cracker), CVE writeups, OWASP cheat sheets, and bug bounty methodologies for attacking JWT-based authentication.

From OWASP JWT Cheat Sheet

Date Added Link Excerpt
2026-04-10 NEW 2026PortSwigger KB: JWT none algorithm supportedPortSwigger KB: JWT none algorithm supported
2026-04-10 NEW 2026Intigriti: Exploiting JWT vulnerabilities — advanced exploitation guideIntigriti: Exploiting JWT vulnerabilities — advanced exploitation guide
2026-04-10 NEW 2026Vaadata: JWT vulnerabilities, common attacks and security best practicesVaadata: JWT vulnerabilities, common attacks and security best practices
2026-04-10 NEW 2026WorkOS: JWT algorithm confusion attacks explainedWorkOS: JWT algorithm confusion attacks explained
2026-04-10 NEW 2026PentesterLab: Another JWT Algorithm Confusion Vulnerability (CVE-2024-54150)PentesterLab: Another JWT Algorithm Confusion Vulnerability (CVE-2024-54150)
2026-04-10 NEW 2026Curity: JWT Security Best PracticesCurity: JWT Security Best Practices
2026-04-10 NEW 2026RFC 8725: JSON Web Token Best Current PracticesRFC 8725: JSON Web Token Best Current Practices
2026-04-10 NEW 2026Auth0: Critical vulnerabilities in JSON Web Token librariesAuth0: Critical vulnerabilities in JSON Web Token libraries
2026-04-10 NEW 2026OWASP WSTG: Testing JSON Web TokensOWASP WSTG: Testing JSON Web Tokens
2026-04-10 NEW 2026OWASP JSON Web Token for Java Cheat SheetOWASP JSON Web Token for Java Cheat Sheet
2026-04-10 NEW 2026KathanP19/HowToHunt: JWTKathanP19/HowToHunt: JWT
2026-04-10 NEW 2026tuhin1729 Bug Bounty Methodology: JWTtuhin1729 Bug Bounty Methodology: JWT
2026-04-10 NEW 2026HackTricks: JWT vulnerabilitiesHackTricks: JWT vulnerabilities
2026-04-10 NEW 2026PayloadsAllTheThings: JSON Web TokenPayloadsAllTheThings: JSON Web Token
2026-04-10 NEW 2026DontPanicO/jwtXploiter: A tool to test the security of JSON Web TokensDontPanicO/jwtXploiter: A tool to test the security of JSON Web Tokens
2026-04-10 NEW 2026brendan-rius/c-jwt-cracker: JWT brute-force cracker in Cbrendan-rius/c-jwt-cracker: JWT brute-force cracker in C
2026-04-10 NEW 2026mazen160/jwt-pwn: Security testing scripts for JWTmazen160/jwt-pwn: Security testing scripts for JWT
2026-04-10 NEW 2026jwt_tool Attack Methodology wikijwt_tool Attack Methodology wiki
2026-04-10 NEW 2026ticarpi/jwt_tool: A toolkit for testing, tweaking and cracking JSON Web Tokensticarpi/jwt_tool: A toolkit for testing, tweaking and cracking JSON Web Tokens
2026-04-10 NEW 2026Working with JWTs in Burp SuiteWorking with JWTs in Burp Suite
2026-04-10 NEW 2026JSON Web Token Attacker Burp extensionJSON Web Token Attacker Burp extension
2026-04-10 NEW 2026JWT Scanner Burp extensionJWT Scanner Burp extension
2026-04-10 NEW 2026PortSwigger jwt-editor: Burp Suite extension for editing and signing JWTsPortSwigger jwt-editor: Burp Suite extension for editing and signing JWTs
2026-04-10 NEW 2026Algorithm confusion attacks | Web Security AcademyAlgorithm confusion attacks | Web Security Academy
2026-04-10 NEW 2026JWT attacks | Web Security AcademyJWT attacks | Web Security Academy

Frequently Asked Questions

What is JWT algorithm confusion?
Algorithm confusion (also called key confusion) exploits servers that accept multiple JWT signing algorithms. The classic example: a server expects an RS256 (asymmetric) signature but accepts HS256 (symmetric). An attacker switches the alg header to HS256 and signs the token using the server's RSA public key as the HMAC secret — turning a verification key into a signing key.
What is the JWT "none" algorithm vulnerability?
The JWT specification allows an alg value of "none", meaning the token is unsigned. Some libraries historically accepted this even for tokens that should have been verified, letting an attacker forge any payload. Modern libraries reject "none" by default, but the bug periodically resurfaces in custom implementations and lesser-used languages.
Should I store JWTs in localStorage or cookies?
Both have tradeoffs. localStorage is vulnerable to XSS — any script on the page can read the token. Cookies with HttpOnly, Secure, and SameSite=Strict prevent XSS theft but introduce CSRF risk if not handled. For most applications, HttpOnly cookies with proper CSRF defenses are the safer choice. Refresh-token rotation and short JWT lifetimes reduce the impact either way.

Weekly AppSec Digest

Get new resources delivered every Monday.