Executive brief
python-jose, a library used by applications to validate JSON Web Tokens (JWTs), fails to properly validate asymmetric cryptographic keys when initializing HMAC-based signatures. An attacker with access to a service's public key can forge valid JWTs that the library will accept, potentially allowing unauthorized access or privilege escalation. This is a regression—an incomplete fix for a prior token forgery vulnerability.
Technical details
python-jose fails to properly validate key formats during HMAC (HS256) initialization, accepting DER-encoded public keys that lack PEM armor or SSH prefixes. An attacker with knowledge of a service's public key (often publicly available) can construct and sign tokens using the HMAC algorithm, bypassing asymmetric signature verification when explicit algorithm restrictions are not enforced. The vulnerability is an incomplete fix for CVE-2024-33663, which addressed similar algorithm confusion with OpenSSH ECDSA keys. No authentication or user interaction is required; exploitation requires only network access to a service using the vulnerable library. Patched versions enforce stricter key format validation to prevent key confusion between asymmetric and symmetric algorithms.
Affected products
- python-jose python-jose through 3.5.0
Timeline
- 2026-09-03: disclosed
- other: Related to incomplete fix for CVE-2024-33663 (prior algorithm confusion vulnerability)