Cyber Risks · PortSwigger Research

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