CVE-2026-102266
HighCVSS 7.4Summary
PyJWT is a Python implementation of JSON Web Token standards. From 2.13.0 until 2.14.0, HMACAlgorithm.from_jwk is affected because the PyJWK verification path used the decoded key without applying prepare_key validation. When a trusted JWK Set contains an oct entry with an empty k value, an attacker signs an HMAC token with the same zero-length key accepted by PyJWT. Consequently, a forged token can carry arbitrary authenticated claims.
Risk Assessment
An attacker can create forged HMAC tokens with arbitrary claims, leading to authentication bypass and unauthorized access. This affects applications using PyJWK with trusted JWK Sets.
Recommendation
Update PyJWT to version 2.14.0. Ensure trusted JWK Sets do not contain oct entries with empty k values.
Other vulnerabilities in PyJWT
See all- CVE-2026-102275Medium
PyJWT is a Python implementation of JSON Web Token standards. From 2.1.0 until 2.15.0, PyJWT OKPAlgorithm.from_jwk in jwt/algorithms.py is affected because private-JWK import path does not compare the public key derived from d with x. This occurs when an OKP private JWK supplies non-corresponding x and d components. As a result, identity derived from x can differ from operations performed with d.
- CVE-2026-102274Medium
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.from_jwk in jwt/api_jwk.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.
- CVE-2026-102273High
PyJWT is a Python implementation of JSON Web Token standards. From 2.13.0 until 2.14.0, HMACAlgorithm.prepare_key is affected because the HMAC key guard only recognizes top-level public JWK forms and misses container representations. When an application allows HMAC and asymmetric algorithms and passes a public JWK container as the raw key, public asymmetric key material is accepted as the HMAC secret. Consequently, an attacker who knows the public key can forge a token with arbitrary authenticated claims.
- CVE-2026-102272High
PyJWT is a Python implementation of JSON Web Token standards. From 2.13.0 until 2.14.0, HMACAlgorithm.prepare_key in jwt/algorithms.py is affected because the raw-JWK detector does not normalize accepted Unicode byte-order marks before checking for JSON. When a public JWK is prefixed with a UTF-8 BOM and used in a mixed-algorithm verification path, the public JWK bypasses asymmetric-key detection and becomes the HMAC secret. Consequently, an attacker who knows the public key can forge authenticated tokens.
- CVE-2026-102271High
PyJWT is a Python implementation of JSON Web Token standards. From 2.4.0 until 2.14.0, PyJWT HMACAlgorithm.prepare_key is affected because the asymmetric-key guard relies on textual markers that are absent from DER encoding. When an application mixes HMAC and asymmetric algorithms and supplies a DER public key as the shared verification key, PyJWT uses public DER bytes as an HMAC secret. Consequently, an attacker who knows the public key can forge authenticated HMAC tokens.
- CVE-2026-102270Medium
PyJWT is a Python implementation of JSON Web Token standards. Prior to 2.14.0, PyJWT is_pem_format is affected because lazy PEM regular expression backtracks extensively. This occurs when a certificate-like input contains repeated BEGIN markers without a matching END marker. As a result, is_pem_format performs unbounded backtracking while searching for a PEM end marker.
- CVE-2026-102269Medium
PyJWT is a Python implementation of JSON Web Token standards. Prior to 2.14.0, PyJWT signature segment is affected because signature segment decoding accepts characters outside the canonical Base64URL representation. This occurs when non-Base64URL characters are appended to a valid compact JWS signature segment. As a result, base64url_decode produces the same signature bytes for different serialized segments.
- CVE-2026-102267High
PyJWT is a Python implementation of JSON Web Token standards. Prior to 2.14.0, PyJWT PyJWKClient is affected because redirect destinations are not revalidated against the JWKS trust boundary. When a configured trusted JWKS endpoint returns an attacker-influenced redirect, PyJWKClient follows the redirect and consumes the redirected response as key material. Consequently, forwarded credentials may be disclosed or verification keys may be substituted.
- CVE-2026-102265Medium
PyJWT is a Python implementation of JSON Web Token standards. From 2.13.0 until 2.14.0, PyJWS._load in jwt/api_jws.py is affected because parser catches ValueError but not RecursionError. This occurs when a deeply nested token header reaches json.loads. As a result, RecursionError escapes the documented PyJWT error hierarchy.
- CVE-2026-101918Medium
PyJWT is a Python implementation of JSON Web Token standards. From 2.0.0a1 until 2.15.0, 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, potentially leading to HTTP 500 responses on unauthenticated requests. Fixed in version 2.15.0.
Original NVD description (English source)
PyJWT is a Python implementation of JSON Web Token standards. From 2.13.0 until 2.14.0, HMACAlgorithm.from_jwk is affected because PyJWK verification path used the decoded key without applying prepare_key validation. This occurs when a trusted JWK Set contains an oct entry with an empty k value. As a result, an attacker signs an HMAC token with the same zero-length key accepted by PyJWT. Consequently, forged token can carry arbitrary authenticated claims. This issue is fixed in version 2.14.0.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

