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-06-29. Synthesized from 108 of 108 curated resources. Browse all 108 JWT resources →

Problem Framing

JSON Web Tokens (JWTs) have become a ubiquitous mechanism for securely transmitting information between parties, particularly in authentication and authorization contexts within modern web applications and APIs. Their stateless nature, compact representation, and self-contained claims make them attractive for distributed systems and microservices architectures. However, this prevalence also means that misconfigurations and implementation flaws in JWT handling can lead to significant security vulnerabilities, ranging from privilege escalation to complete authentication bypass.

Core Mechanics

A JWT is composed of three parts, separated by dots (.): a Header, a Payload, and a Signature. Each part is typically Base64URL-encoded.

The common format is HEADER.PAYLOAD.SIGNATURE.

Notable Techniques and Vulnerabilities

Numerous vulnerabilities stem from incorrect implementation or misuse of JWTs. These can be broadly categorized:

Signature Verification Flaws

The most fundamental security guarantee of a JWT is its signature. Weaknesses here allow attackers to tamper with the token's contents.

Header Parameter Exploitation

JWT headers contain metadata that can be manipulated if not properly validated.

Claim Validation Flaws

JWTs contain claims that represent statements about the entity. Incorrect validation of these claims can lead to vulnerabilities.

Cryptographic Key Management Issues

The security of JWTs hinges on the proper management of cryptographic keys.

Library Vulnerabilities

Many popular JWT libraries have historically contained vulnerabilities that, if not patched, expose applications.

JWE Specific Vulnerabilities

JSON Web Encryption (JWE) adds another layer of complexity and potential vulnerabilities.

Detection and Prevention

Securing JWT implementations requires a multi-faceted approach focusing on robust validation, secure key management, and adherence to best practices.

Key Validation and Management

Token Validation

Secure Transmission and Storage

Secure Coding Practices

Detection and Prevention Tools

Several tools can assist in identifying JWT vulnerabilities:

Recent Developments

The JWT landscape is continuously evolving, with new vulnerabilities and best practices emerging. Recent focus areas include:

Where to Go Deeper

Sources cited in this guide

  1. Can Snyk Detect JWT Security Issues? — snyk.io
  2. JSON Web Token Attacks and Vulnerabilities — Acunetix — acunetix.com
  3. JWT Security Best Practices (Phase Two) — phasetwo.io
  4. The Ultimate Guide to JWT Vulnerabilities and Attacks — pentesterlab.com
  5. OWASP WSTG: Testing JSON Web Tokens — owasp.org
  6. PortSwigger KB: JWT none algorithm supported — portswigger.net
  7. Insecure JSON Web Tokens (The Hacker Recipes) — thehacker.recipes
  8. Known Exploits and Attacks (jwt_tool Wiki) — github.com
  9. JWT Authentication Bypass Using alg:none - CTF Writeup — medium.com
  10. November CTF Challenge: Exploiting JWT vulnerabilities to achieve RCE — intigriti.com
  11. Intigriti: Exploiting JWT vulnerabilities — advanced exploitation guide — intigriti.com
  12. PayloadsAllTheThings: JSON Web Token — github.com
  13. JWT attacks | Web Security Academy — portswigger.net
  14. Curity: JWT Security Best Practices — curity.io
  15. tuhin1729 Bug Bounty Methodology: JWT — github.com
  16. Brute Forcing HS256 is Possible — auth0.com
  17. Vaadata: JWT vulnerabilities, common attacks and security best practices — vaadata.com
  18. brendan-rius/c-jwt-cracker: JWT brute-force cracker in C — github.com
  19. jwt_tool Attack Methodology wiki — github.com
  20. CVE-2026-22817: JWT Algorithm Confusion in Hono — dev.to
  21. JWT authentication bypass via algorithm confusion (siunam) — siunam321.github.io
  22. JWT Algorithm Confusion Attack: Two Active CVEs in 2026 — tools.pinusx.com
  23. JWT Algorithm Confusion: Turning RS256 Tokens into HS256 Disasters — medium.com
  24. JWT Vulnerabilities List: 2026 Security Risks & Mitigation Guide (Red Sentry) — redsentry.com
  25. JWT Algorithm Confusion Attacks: CVE-2026-22817 Fix Guide — dev.to
  26. Attacking JWT authentication — sjoerdlangkemper.nl
  27. WorkOS: JWT algorithm confusion attacks explained — workos.com
  28. Auth0: Critical vulnerabilities in JSON Web Token libraries — auth0.com
  29. Algorithm confusion attacks | Web Security Academy — portswigger.net
  30. CVE-2026-34950 fast-jwt: Incomplete Fix for CVE-2023-48223 — endorlabs.com
  31. How JWT Libraries Block Algorithm Confusion: Code Review Lessons — pentesterlab.com
  32. CVE-2024-33663: Python-jose Algorithm Confusion — sentinelone.com
  33. PentesterLab: Another JWT Algorithm Confusion Vulnerability (CVE-2024-54150) — pentesterlab.com
  34. PortSwigger jwt-editor: Burp Suite extension for editing and signing JWTs — github.com
  35. JWT authentication bypass via kid header path traversal (siunam) — siunam321.github.io
  36. JWT Signature Bypass via kid Path Traversal — invicti.com
  37. JWT Scanner Burp extension — portswigger.net
  38. JWT Signature Bypass via kid SQL injection — invicti.com
  39. JWT Forgery via unvalidated jku parameter (Invicti) — invicti.com
  40. HackerOne: Argo CD JWT audience claim not verified — hackerone.com
  41. JWT Signature Bypass via unvalidated jku parameter — invicti.com
  42. Lab: JWT authentication bypass via jku header injection — portswigger.net
  43. KathanP19/HowToHunt: JWT — github.com
  44. DontPanicO/jwtXploiter: A tool to test the security of JSON Web Tokens — github.com
  45. Authlib Critical JWT Forgery (CVE-2026-27962) — thehackerwire.com
  46. Top 3 security best practices for handling JWTs — snyk.io
  47. JWT Token Lifecycle: Expiration, Refresh, and Revocation — skycloak.io
  48. JWT Security Best Practices for 2025 (JWT.app) — jwt.app
  49. draft-ietf-oauth-rfc8725bis: JSON Web Token Best Current Practices — datatracker.ietf.org
  50. OWASP JSON Web Token for Java Cheat Sheet — cheatsheetseries.owasp.org
  51. JWT (Json Web Token) Audience aud versus Client_Id - What's the difference? — stackoverflow.com
  52. CVE-2024-53861: PyJWT Issuer Field Partial Match — vulert.com
  53. JWT Security in 2025: Critical Vulnerabilities for B2B SaaS — securityboulevard.com
  54. These are the security issues with JWT — scip.ch
  55. Cracking JWT Keys - Authentication Lab — authlab.digi.ninja
  56. Top 3 security best practices for handling JWTs — snyk.io
  57. CVE-2026-32597: PyJWT Information Disclosure Vulnerability — sentinelone.com
  58. CVE-2025-45768: PyJWT Information Disclosure Vulnerability — sentinelone.com
  59. ctf-jwt-token: Vulnerability in early JWT node.js library (GitHub) — github.com
  60. Severe Security Flaw Found in jsonwebtoken Library — thehackernews.com
  61. Proof of Concept for CVE-2026-29000 (pac4j-jwt) — github.com
  62. CVE-2026-29000: pac4j-jwt Authentication Bypass — penligent.ai
  63. CVE-2026-29000: Authentication Bypass in pac4j-jwt — arcticwolf.com
  64. CVE-2026-23993: JWT Authentication Bypass in HarbourJwt via Unknown alg — pentesterlab.com
  65. Python-JOSE Security Risk: CVE-2024-33663 Explained — ethicalhacking.uk
  66. Golang JWT access restriction bypass vulnerability — snyk.io
  67. Detecting CVE-2026-0265 at Scale: PAN-OS CAS Authentication Bypass — bishopfox.com
  68. RFC 8725: JSON Web Token Best Current Practices — ietf.org
  69. JWT Security Guide: Best Practices & Implementation (Gupta Deepak) — guptadeepak.com
  70. Where to Store the JSON Web Token (JWT)? — medium.com
  71. ticarpi/jwt_tool: A toolkit for testing, tweaking and cracking JSON Web Tokens — github.com
  72. Detecting JWT Security Issues — snyk.io
  73. Hacker Tools: JWT_Tool — intigriti.com
  74. HackTricks: JWT vulnerabilities — book.hacktricks.xyz
  75. jwt-hack: JSON Web Token Hack Toolkit (GitHub) — github.com
  76. mazen160/jwt-pwn: Security testing scripts for JWT — github.com
  77. dr34mhacks/jwtauditor: JWT Auditor – Analyze, break, and understand your tokens like a pro. — github.com
  78. Working with JWTs in Burp Suite — portswigger.net
  79. JSON Web Token Attacker Burp extension — portswigger.net
  80. Introducing CookieMonster: a tool for breaking stateless authentication — ian.sh
  81. HackerOne: Critical vulnerability in JWE Specification — hackerone.com
  82. RFC 8725 - JSON Web Token Best Current Practices — datatracker.ietf.org
  83. Lab: JWT authentication bypass via weak signing key — portswigger.net
📚 This guide is synthesized from the full text of resources curated in the JWT library, and refreshed as new material is added.