Cyber Risks · PortSwigger Research

Lab: JWT authentication bypass via kid header path traversal

Summary: This PortSwigger lab demonstrates a JWT authentication bypass in which the server uses the kid header parameter to fetch a signing key from its filesystem. By pointing kid at /dev/null via a path traversal sequence and signing the token with an empty string as the symmetric key, the attacker changes the sub claim to administrator and reaches the /admin panel.

What's compelling: A single header field that the server trusts to locate a key file let a regular user, logged in as wiener, reach the admin panel and delete the user carlos. Any application that resolves signing keys from user-influenced input inherits that same path traversal exposure.

Read the original at PortSwigger Research ↗

Topics
Vulnerabilities & Patching
Related