PYSEC-2026-4152: PyJWT: Malformed RSA JWK aborts parsing of an entire JWK Set
PyJWT is a Python implementation of JSON Web Token standards. From 2.9.0 until 2.14.0, PyJWKSet does not catch the plain ValueError raised for malformed RSA JWK components by RSAAlgorithm.fromjwk in jwt/apijwk.py. This occurs when a JWK Set contains a malformed RSA key alongside otherwise usable keys. As a result, one malformed member aborts construction of the entire PyJWKSet. Consequently, applications can experience authentication failures or request-level denial of service. This issue is fixed in version 2.14.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
PyJWTto a version that resolves this vulnerability.Fixed in 2.14.0
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Applications using PyJWT versions from 2.9.0 up to, but not including, 2.14.0 are affected when they construct a PyJWKSet from a JWK Set containing a malformed RSA key alongside usable keys.
What does an attacker need to trigger the impact?
The application must process a JWK Set that includes a malformed RSA JWK component. The malformed member causes PyJWKSet construction to abort, even if other keys in the set are valid, resulting in authentication failures or request-level denial of service.
How can the issue be remediated?
Upgrade PyJWT to version 2.14.0, which fixes the uncaught ValueError raised while parsing malformed RSA JWK components.