Impact
The flaw emerges when PyJWT's internal _merge_options method can alter a mutable options mapping supplied by the caller when signature verification is disabled. If the same mapping object is later reused with signature verification turned on, the mutated values remain and prevent expiration, not‑before, issued‑at, audience, issuer, subject, and JWT ID checks from being performed. This allows an attacker to craft a signed token containing invalid claims that will still be accepted by the library. The weakness corresponds to CWE-358 – mutability of data structures leading to unexpected side effects, and CWE-471 – improper handling of mutable objects, resulting in compromised token validation and potential unauthorized access.
Affected Systems
The vulnerability affects the PyJWT package from jpadilla:pyjwt. Versions 2.11.0 through 2.13.0 are impacted. Applications that reuse an options dictionary across decode calls may be affected.
Risk and Exploitability
The CVSS score for this issue is 6.5, indicating moderate severity. The EPSS score is not available, and the vulnerability is not listed in CISA's KEV catalogue. Exploitation requires code that supplies a mutable options mapping, reuses it between decoding calls, and toggles the verify_signature flag. As a result, the risk is primarily faced by libraries or applications that deliberately reuse options dictionaries, and the likelihood of a remote exploitation scenario is low unless the attacker controls token decoding logic.
OpenCVE Enrichment
Github GHSA