Lab: JWT authentication bypass via jwk header injection
Summary: This PortSwigger lab presents a JWT authentication bypass in which the server accepts the jwk parameter in the JWT header, letting a token embed its own verification key, but fails to check whether that key came from a trusted source. The exercise has the user generate an RSA key pair in Burp's JWT Editor, change the sub claim to administrator, sign the token with the embedded JWK, and reach /admin to delete the user carlos.
Key Takeaway: A server that trusts a key supplied inside the token verifies the attacker's signature against the attacker's own key, so a single changed sub claim turns a standard user account into administrator access.
Read the original at PortSwigger Research ↗
- Topics
- Vulnerabilities & Patching
- Related
- Attackers Exploit UnrealIRCd Flaw That Enables Server-Level Command Injection Cyber Risks · Nov 14, 2026U.S. CISA adds Check Point and UnrealIRCd flaws to its Known Exploited Vulnerabilities catalog Cyber Risks · Nov 14, 2026PostgreSQL Patches 52 Flaws, Including 22-Year-Old Bug Enabling Authenticated RCE Cyber Risks · Nov 13, 2026