Description
PyJWT is a Python implementation of JSON Web Token standards. Prior to 2.14.0, is_pem_format in jwt/utils.py is affected because is_pem_format does not recognize every PEM representation accepted by the cryptography loader. This occurs when an application mixes HMAC and asymmetric algorithms and supplies a mutated public-key PEM as raw key bytes. As a result, HMACAlgorithm.prepare_key treats the unrecognized asymmetric public key as an HMAC secret. Consequently, an attacker who knows the public key can forge authenticated HMAC tokens. This issue is fixed in version 2.14.0.
Published: 2026-09-28
Score: 9.1 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Authentication Bypass via Forged Tokens
Action: Patch Immediately
AI Analysis

Impact

PyJWT is a Python implementation of JSON Web Token standards. Before version 2.14.0, the function that detects a PEM format was incomplete, allowing certain public‑key PEMs to be misidentified as raw HMAC secrets. The flaw permits an attacker who knows the public key to craft a token signed with a bogus HMAC secret that the library accepts as a valid key, effectively forging authenticated tokens. This results in a complete authentication bypass and possibilites arbitrary data tampering, classified as CWE‑347.

Affected Systems

The vulnerability affects the jpadilla:pyjwt library in all releases prior to 2.14.0. Users employing any earlier version which mixes HMAC and asymmetric algorithms or supplies a mistakenly altered PEM key as the secret are impacted. The fix is issued in 2.14.0 and later releases.

Risk and Exploitability

The CVSS score of 9.1 reflects a high‑severity risk. No EPSS score is available, and the issue is not listed in the CISA KEV catalog. The attack vector is not explicitly stated, but since JSON Web Tokens are transmitted between client and server, a remote attacker could achieve token forgery by providing the public key and mutating it to bypass the guard ( the likely attack vector is remote). The recommendation is to apply the vendor patch, enforce correct key usage and apply a temporary validation filter if a delay is unavoidable.

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

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the PyJWT library to version 2.14.0 or later, which fixes the PEM recognition bug.
  • Ensure that your application does not mix HMAC and asymmetric signing algorithms, and that public keys are supplied in a proper format.
  • If an immediate upgrade is not possible, enforce a strict check that the key provided to the HMAC algorithm matches the expected HMAC secret format and reject any key that appears to be in PEM form; this mitigates the confusion guard bypass until the patch is applied.

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

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-ffc3-869f-jxw9 PyJWT: Asymmetric-PEM detection bypass: whitespace/line-ending-mutated public keys skip the HS/asymmetric confusion guard
History

Wed, 07 Oct 2026 20:45:00 +0000

Type Values Removed Values Added
First Time appeared Pyjwt Project
Pyjwt Project pyjwt
CPEs cpe:2.3:a:pyjwt_project:pyjwt:*:*:*:*:*:*:*:*
Vendors & Products Pyjwt Project
Pyjwt Project pyjwt

Tue, 29 Sep 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Mon, 28 Sep 2026 22:00:00 +0000

Type Values Removed Values Added
First Time appeared Jpadilla
Jpadilla pyjwt
Vendors & Products Jpadilla
Jpadilla pyjwt

Mon, 28 Sep 2026 20:45:00 +0000

Type Values Removed Values Added
Description PyJWT is a Python implementation of JSON Web Token standards. Prior to 2.14.0, is_pem_format in jwt/utils.py is affected because is_pem_format does not recognize every PEM representation accepted by the cryptography loader. This occurs when an application mixes HMAC and asymmetric algorithms and supplies a mutated public-key PEM as raw key bytes. As a result, HMACAlgorithm.prepare_key treats the unrecognized asymmetric public key as an HMAC secret. Consequently, an attacker who knows the public key can forge authenticated HMAC tokens. This issue is fixed in version 2.14.0.
Title PyJWT: Asymmetric-PEM detection bypass: whitespace/line-ending-mutated public keys skip the HS/asymmetric confusion guard
Weaknesses CWE-347
References
Metrics cvssV3_1

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


Subscriptions

Jpadilla Pyjwt
Pyjwt Project Pyjwt
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-09-29T13:59:11.421Z

Reserved: 2026-09-28T20:11:16.658Z

Link: CVE-2026-102268

cve-icon Vulnrichment

Updated: 2026-09-29T13:58:49.774Z

cve-icon NVD

Status : Analyzed

Published: 2026-09-28T21:17:14.600

Modified: 2026-10-07T20:25:03.030

Link: CVE-2026-102268

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-28T21:45:06Z

Weaknesses
  • CWE-347

    Improper Verification of Cryptographic Signature