appsec.fyi

JWT — A Practical Guide

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

JWT: A Practical Guide

Curated and synthesized by . Last updated 2026-09-01. Synthesized from 108 of 108 curated resources. Browse all 108 JWT resources →

Problem Framing

JSON Web Tokens (JWTs) are a ubiquitous standard for securely transmitting information between parties as a JSON object, commonly used for authentication and authorization [1][2][3]. Their compact, self-contained nature and cryptographic signing provide a stateless approach to session management, making them attractive for modern distributed systems and APIs [1][4][5]. However, the flexibility and widespread adoption of JWTs also introduce a significant attack surface. Misconfigurations and improper implementation of JWT handling by developers can lead to critical vulnerabilities, allowing attackers to bypass authentication, escalate privileges, or impersonate users [6][7][2][1][4][3][8][9]. Understanding these threats is paramount for any application security professional working with or reviewing systems that utilize JWTs.

Core Mechanics

A JWT is fundamentally composed of three parts, separated by dots (.): a Header, a Payload, and a Signature [4][5][9].

There are two primary categories of algorithms used for signing JWTs:

Notable Techniques and Attack Vectors

The security of JWTs hinges on the correct implementation of signature verification and the secure management of signing keys. Many attacks exploit flaws in these areas.

Signature Verification Bypasses

A fundamental vulnerability arises from neglecting to verify the JWT's signature. This can occur in several ways:

Algorithm Confusion (Key Confusion)

This class of attack exploits the JWT header's alg parameter. If the server's verification logic relies on the alg value provided in the token itself, rather than enforcing a pre-configured, expected algorithm, attackers can switch algorithms to forge tokens [25][26][18][27][28][29][8][19][30][31][24][12][23].

Key Management and Injection Vulnerabilities

Weaknesses in how signing keys are managed, referenced, or handled can also lead to JWT compromise.

Other Vulnerabilities

Detection and Prevention

Securing JWT implementations requires a multi-layered approach, focusing on rigorous validation, secure key management, and up-to-date libraries.

Secure Verification Practices

Secure Key Management

Secure Storage and Transmission

Token Lifecycle Management

Tooling

Several tools can aid in the analysis, testing, and exploitation of JWT vulnerabilities:

Recent Developments and Trends

The landscape of JWT vulnerabilities continues to evolve, with new CVEs emerging that highlight recurring implementation flaws. Recent trends include:

Where to Go Deeper

For a more in-depth understanding and practical experience with JWT security, consider the following resources:

Sources cited in this guide

  1. Can Snyk Detect JWT Security Issues? — snyk.io
  2. Top 3 security best practices for handling JWTs — snyk.io
  3. JWT Security Best Practices (Phase Two) — phasetwo.io
  4. JSON Web Token Attacks and Vulnerabilities — Acunetix — acunetix.com
  5. JWT Security Guide: Best Practices & Implementation (Gupta Deepak) — guptadeepak.com
  6. Revisiting JWT Token Forgery Attack on Recent Bounty Target — infosecwriteups.com
  7. JWTweak v2.1: A Guided, Offline Toolkit for Modern JWT Attacks — infosecwriteups.com
  8. Understanding JWT Security and Common Vulnerabilities (secops) — secops.group
  9. Vaadata: JWT vulnerabilities, common attacks and security best practices — vaadata.com
  10. OWASP WSTG: Testing JSON Web Tokens — owasp.org
  11. I made a full JWT hacking tutorial + testing suite — hakluke.com
  12. KathanP19/HowToHunt: JWT — github.com
  13. Brute Forcing HS256 is Possible — auth0.com
  14. Two Ways To Mess Up Your JWT Safety Net In Your Own Lab. — infosecwriteups.com
  15. The Ultimate Guide to JWT Vulnerabilities and Attacks — pentesterlab.com
  16. Detecting JWT Security Issues — snyk.io
  17. PortSwigger KB: JWT none algorithm supported — portswigger.net
  18. Known Exploits and Attacks (jwt_tool Wiki) — github.com
  19. JWT Algorithm Confusion Attacks: CVE-2026-22817 Fix Guide — dev.to
  20. Insecure JSON Web Tokens (The Hacker Recipes) — thehacker.recipes
  21. ctf-jwt-token: Vulnerability in early JWT node.js library (GitHub) — github.com
  22. JWT Authentication Bypass Using alg:none - CTF Writeup — medium.com
  23. PayloadsAllTheThings: JSON Web Token — github.com
  24. dr34mhacks/jwtauditor: JWT Auditor – Analyze, break, and understand your tokens like a pro. — github.com
  25. CVE-2026-22817: JWT Algorithm Confusion in Hono — dev.to
  26. How JWT Libraries Block Algorithm Confusion: Code Review Lessons — pentesterlab.com
  27. JWT authentication bypass via algorithm confusion (siunam) — siunam321.github.io
  28. JWT Algorithm Confusion Attack: Two Active CVEs in 2026 — tools.pinusx.com
  29. JWT Algorithm Confusion: Turning RS256 Tokens into HS256 Disasters — medium.com
  30. WorkOS: JWT algorithm confusion attacks explained — workos.com
  31. Algorithm confusion attacks | Web Security Academy — portswigger.net
  32. Auth0: Critical vulnerabilities in JSON Web Token libraries — auth0.com
  33. Hacker Tools: JWT_Tool — intigriti.com
  34. Cracking JWT Keys - Authentication Lab — authlab.digi.ninja
  35. brendan-rius/c-jwt-cracker: JWT brute-force cracker in C — github.com
  36. mazen160/jwt-pwn: Security testing scripts for JWT — github.com
  37. jwt_tool Attack Methodology wiki — github.com
  38. CVE-2026-23993: JWT Authentication Bypass in HarbourJwt via Unknown alg — pentesterlab.com
  39. JWT authentication bypass via kid header path traversal (siunam) — siunam321.github.io
  40. JWT Header Parameter Injections — medium.com
  41. JWT Signature Bypass via kid Path Traversal — invicti.com
  42. JWT Signature Bypass via kid SQL injection — invicti.com
  43. tuhin1729 Bug Bounty Methodology: JWT — github.com
  44. JWT Forgery via unvalidated jku parameter (Invicti) — invicti.com
  45. JWT Signature Bypass via unvalidated jku parameter — invicti.com
  46. Lab: JWT authentication bypass via jku header injection — portswigger.net
  47. DontPanicO/jwtXploiter: A tool to test the security of JSON Web Tokens — github.com
  48. PortSwigger jwt-editor: Burp Suite extension for editing and signing JWTs — github.com
  49. CVE-2024-53861: PyJWT Issuer Field Partial Match — vulert.com
  50. HackerOne: Argo CD JWT audience claim not verified — hackerone.com
  51. CVE-2026-32597: PyJWT Information Disclosure Vulnerability — sentinelone.com
  52. Proof of Concept for CVE-2026-29000 (pac4j-jwt) — github.com
  53. CVE-2026-29000: Authentication Bypass in pac4j-jwt — arcticwolf.com
  54. Intigriti: Exploiting JWT vulnerabilities — advanced exploitation guide — intigriti.com
  55. CVE-2025-45768: PyJWT Information Disclosure Vulnerability — sentinelone.com
  56. ticarpi/jwt_tool: A toolkit for testing, tweaking and cracking JSON Web Tokens — github.com
  57. JWT (Json Web Token) Audience aud versus Client_Id - What's the difference? — stackoverflow.com
  58. CVE-2024-33663: Python-jose Algorithm Confusion — sentinelone.com
  59. JWT Security Best Practices for 2025 (JWT.app) — jwt.app
  60. These are the security issues with JWT — scip.ch
  61. Where to Store the JSON Web Token (JWT)? — medium.com
  62. JWT Token Lifecycle: Expiration, Refresh, and Revocation — skycloak.io
  63. JSON Web Token Attacker Burp extension — portswigger.net
  64. Lab: JWT authentication bypass via weak signing key — portswigger.net
  65. Working with JWTs in Burp Suite — portswigger.net
  66. JWT Scanner Burp extension — portswigger.net
  67. HackTricks: JWT vulnerabilities — book.hacktricks.xyz
  68. jwt-hack: JSON Web Token Hack Toolkit (GitHub) — github.com
  69. Introducing CookieMonster: a tool for breaking stateless authentication — ian.sh
  70. PentesterLab: Another JWT Algorithm Confusion Vulnerability (CVE-2024-54150) — pentesterlab.com
  71. python-jwt token forgery CVE-2022-39227 — github.com
  72. Severe Security Flaw Found in jsonwebtoken Library — thehackernews.com
  73. draft-ietf-oauth-rfc8725bis: JSON Web Token Best Current Practices — datatracker.ietf.org
  74. RFC 8725 - JSON Web Token Best Current Practices — datatracker.ietf.org
  75. RFC 8725: JSON Web Token Best Current Practices — ietf.org
  76. JWT attacks | Web Security Academy — portswigger.net
  77. JWT Pentest Book (six2dez) — pentestbook.six2dez.com
  78. JWT Pentest Checklist (Cyber Frogy) — chintangurjar.com
  79. JWT Pentest Checklist v1.0 (Chintan Gurjar) — chintangurjar.com
  80. JSON Web Token Vulnerabilities (0xn3va cheat sheet) — 0xn3va.gitbook.io
  81. Detecting CVE-2026-0265 at Scale: PAN-OS CAS Authentication Bypass — bishopfox.com
  82. Python-JOSE Security Risk: CVE-2024-33663 Explained — ethicalhacking.uk
  83. HackerOne #1210502: Jitsi Authentication Bypass (JWT) — hackerone.com
  84. HackerOne #2472798: Newspack Extended Access JWT bypass — hackerone.com
  85. JWT Vulnerabilities List: 2026 Security Risks & Mitigation Guide (Red Sentry) — redsentry.com
  86. HackerOne: Trint insecure client-side JWT generation — hackerone.com
  87. HackerOne: Linktree account takeover via improper JWT validation — hackerone.com
  88. HackerOne: Critical vulnerability in JWE Specification — hackerone.com
  89. JWT Attack Walk-Through - NCC Group — research.nccgroup.com
  90. A Practical Guide to Attacking JWT — redhuntlabs.com
  91. November CTF Challenge: Exploiting JWT vulnerabilities to achieve RCE — intigriti.com
  92. Golang JWT access restriction bypass vulnerability — snyk.io
  93. Top 3 security best practices for handling JWTs — snyk.io
  94. Attacking JWT authentication — sjoerdlangkemper.nl
  95. Curity: JWT Security Best Practices — curity.io
  96. Stealing Microsoft Teams access tokens in 2025 — blog.randorisec.fr
  97. Authentication Explained: When to Use Basic, Bearer, OAuth2, JWT & SSO | daily.dev — app.daily.dev
  98. JWT vs PASETO: New Era of Token-Based Authentication — medium.com
  99. Securing OAuth 2.0 Token Exchange Flow with Keycloak — sgtm.medium.com
  100. All About Attacking JWT — medium.com
  101. JSON Web Tokens Vulnerabilities and Exploitation. — dk9510.medium.com
  102. JWT [JSON WEB TOKENS] [EXPLANATION & EXPLOITATION] (0x02) — medium.com
📚 This guide is synthesized from the full text of resources curated in the JWT library, and refreshed as new material is added.