Impact
The vulnerability lies in PyJWT’s handling of OKP (Octet Key Pair) JSON Web Keys. The library’s private‑JWK import path does not confirm that the public key component (x) matches the derived key from the private component (d). This is a vulnerability governed by CWE‑345, CWE‑347, and CWE‑348, illustrating improper validation and authentication weaknesses. An attacker can supply a token with mismatched x and d values and, if the receiving application accepts the private‑key parameters from a header without rejecting them, the victim can perform operations as if it possessed the legitimate private key. This allows an attacker to use a stolen sender‑constrained token to impersonate the legitimate issuer and gain unauthorized access or perform restricted actions.
Affected Systems
The issue affects the PyJWT library from versions 2.1.0 through 2.14.x. The fix is included in release 2.15.0. Systems using any earlier releases and that parse OKP JWKs from incoming tokens are vulnerable.
Risk and Exploitability
The CVSS score is 6.5, indicating a moderate severity. EPSS score is reported as less than 1%, suggesting a very low probability of exploitation, and the vulnerability is not listed in CISA’s KEV catalog. Exploitation requires that the target system accepts private‑key parameters from a proof header and does not verify the key consistency, narrowing the attack surface to certain integrations or misconfigured services. With these prerequisites in place, an attacker could successfully forge tokens and impersonate the issuer, but broad remote exploitation is less likely.
OpenCVE Enrichment
Github GHSA