CVE-2026-102266

PyJWK accepts empty HMAC keys, bypassing PyJWT's empty-key validation

Published Sep 28, 2026 CVSS 3.1 · 7.4 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

PyJWT accepts empty HMAC keys, bypassing empty-key validation when a trusted JWK Set contains an oct entry with an empty k value. This allows an attacker to sign an HMAC token with a zero‑length key that PyJWT will accept, enabling the creation of forged tokens carrying arbitrary authenticated claims. The vulnerability is classified as CWE‑347 and can lead to unauthorized access and privilege escalation by impersonating legitimate users.

Affected Systems

The affected product is PyJWT, maintained by jpadilla. Versions from 2.13.0 up to (but not including) 2.14.0 are vulnerable. The issue was resolved in release 2.14.0, so any installation using an earlier 2.13.x version is at risk.

Risk and Exploitability

The CVSS score is 7.4, indicating a high severity. EPSS is not available and the vulnerability is not listed in the CISA KEV catalog. A potential attacker must be able to supply or tamper with a trusted JWK Set containing an oct key with an empty k value, and then sign a token with a zero‑length key. Once the token is accepted, the attacker can impersonate any user, bypass authentication and potentially gain elevated privileges. The exploit requires only that the application rely on PyJWT to validate tokens from the affected JWK Set, so deployments that use such JWKs are at significant risk.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update PyJWT to version 2.14.0 or later
  • Remove any oct entries with empty k values from trusted JWK Sets to prevent usage of zero‑length keys
  • If upgrading is not yet possible, enforce key length validation in your application code or reject tokens signed with algorithms that are not explicitly trusted

Generated by OpenCVE AI on September 28, 2026 at 21:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-9j54-fg26-wv3r PyJWT: PyJWK accepts empty HMAC keys, bypassing PyJWT's empty-key validation
History
Type Values Removed Values Added
First Time appeared Pyjwt Project
Pyjwt Project pyjwt
CPEs cpe:2.3:a:pyjwt_project:pyjwt:2.13.0:*:*:*:*:*:*:*
Vendors & Products Pyjwt Project
Pyjwt Project pyjwt
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Jpadilla
Jpadilla pyjwt
Vendors & Products Jpadilla
Jpadilla pyjwt
Type Values Removed Values Added
Description 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.
Title PyJWK accepts empty HMAC keys, bypassing PyJWT's empty-key validation
Weaknesses CWE-347
References
Metrics cvssV3_1

{'score': 7.4, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N'}

Weaknesses
  • CWE-347

    Improper Verification of Cryptographic Signature

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 29, 2026, 7:35 PM
Reserved
Sep 28, 2026, 8:11 PM
Status
Analyzed
Published
Sep 28, 2026, 9:17 PM
Modified
Oct 7, 2026, 8:55 PM
Severity
Important
Public date
Sep 28, 2026, 8:21 PM