Executive brief
LibJWT is a software library used by applications to handle JSON Web Tokens (JWTs) for authentication and data exchange. A security flaw allows attackers to bypass authentication by tricking the library into using an empty security key for verification. This means an attacker can create their own valid-looking login tokens to gain unauthorized access to systems or escalate their privileges without knowing any actual passwords or secret keys.
Technical details
LibJWT (versions 3.0.0 to 3.3.2) contains an algorithm-confusion vulnerability when using the OpenSSL backend. The library fails to validate that the requested algorithm (e.g., HS256) is compatible with the provided key type (e.g., RSA) if the JWK 'alg' parameter is missing. Because RSA keys and HMAC keys share a union in the library's internal data structures, an RSA key used in an HMAC context results in a zero-length key being passed to OpenSSL's HMAC verification. An attacker can exploit this by providing a token signed with an empty-string HMAC key while referencing a public RSA key from a JWKS. This allows for full token forgery and authentication bypass. The issue is fixed in version 3.3.3.
Affected products
- benmcollins LibJWT 3.0.0 to 3.3.2
Timeline
- 2026-05-04: advisory: GitHub Security Advisory published
- 2026-05-15: disclosed: CVE published to NVD