PyJWT
PyJWT: Unauthenticated RecursionError DoS in pre-verification payload parse (PyJWKClient.get_signing_key_from_jwt / verify_signature=False)
PyJWT is a Python implementation of JSON Web Token standards. From 2.0.0a1 until 2.15.0, PyJWT PyJWKClient.get_signing_key_from_jwt is affected because payload parser catches ValueError but not RecursionError. This occurs when an attacker-controlled recursively nested payload reaches json.loads. As a result, documented PyJWT exception handling does not contain the failure. Consequently, an unauthenticated request can raise an exception that may produce an HTTP 500 response. The advisory-defined affected implementation also includes jwt/api_jwt.py, verify_signature=False. This issue is fixed in version 2.15.0.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 2.0.0a1, < 2.15.0
Fixed in 2.15.0
Mitigation
Upgrade pyjwt to 2.15.0 or later.
References
- Vendor advisory github.com/jpadilla/pyjwt/security/advisories/…
- Patch github.com/jpadilla/pyjwt/commit/5fde08a6cf906…
- Release notes github.com/jpadilla/pyjwt/releases/tag/2.15.0
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.