CVE-2026-102272

PyJWT BOM Bypass

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.prepare_key in jwt/algorithms.py is affected because raw-JWK detector does not normalize accepted Unicode byte-order marks before checking for JSON. This occurs when a public JWK is prefixed with a UTF-8 BOM and used in a mixed-algorithm verification path. As a result, public JWK bypasses asymmetric-key detection and becomes the HMAC secret. Consequently, an attacker who knows the public key can forge authenticated tokens. This issue is fixed in version 2.14.0.

Analysis

AI-generated

Technical impact

The vulnerability is a CWE-347 flaw that allows a JSON Web Token forgery attack because PyJWT fails to normalize Unicode byte‑order marks in raw‑JWK detectors. When a public JWK is prefixed with a UTF‑8 BOM and used in a mixed‑algorithm verification path, the library treats the key as an HMAC secret, allowing an attacker who knows the public key to forge tokens. This flaw permits unauthenticated token creation, providing attackers with the ability to impersonate users or elevate privileges in applications that rely on JWT validation.

Affected Systems

The issue affects pyjwt releases 2.13.0 through 2.14.0. The library’s HMACAlgorithm.prepare_key function is vulnerable until version 2.14.0, where the fix normalizes BOM characters. Systems using PyJWT to verify signed tokens and that supply public JWKs should ensure they are running a patched version.

Risk and Exploitability

The vulnerability carries a CVSS score of 7.4 and is not listed in the CISA KEV database. An attacker must know the public JWK and be able to supply it to a verification path that mixes algorithms; the lack of an available EPSS score makes it unclear how frequently it is exploited. This is a CWE-347 flaw, and the ability to forge valid authentication tokens represents a high‑impact attack vector, making the flaw a serious concern for applications that trust JWTs from external providers.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade PyJWT to version 2.14.0 or later to apply the BOM normalization fix, which addresses the CWE‑347 vulnerability.
  • If upgrading is not yet possible, pre‑validate public JWK inputs to strip any leading BOM characters before passing them to jwt.decode, mitigating the CWE‑347 flaw.
  • Review and rotate any tokens issued prior to the fix, and monitor authentication logs for anomalous claims that may indicate forged tokens.

Generated by OpenCVE AI on September 28, 2026 at 22:55 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-r6x4-923q-g947 PyJWT BOM Bypass
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.prepare_key in jwt/algorithms.py is affected because raw-JWK detector does not normalize accepted Unicode byte-order marks before checking for JSON. This occurs when a public JWK is prefixed with a UTF-8 BOM and used in a mixed-algorithm verification path. As a result, public JWK bypasses asymmetric-key detection and becomes the HMAC secret. Consequently, an attacker who knows the public key can forge authenticated tokens. This issue is fixed in version 2.14.0.
Title PyJWT BOM Bypass
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, 2:45 PM
Reserved
Sep 28, 2026, 8:11 PM
Status
Analyzed
Published
Sep 28, 2026, 9:17 PM
Modified
Oct 6, 2026, 6:34 PM
Severity
Important
Public date
Sep 28, 2026, 8:36 PM