Description
PyJWT is a Python implementation of JSON Web Token standards. From 2.13.0 until 2.14.0, PyJWT HMACAlgorithm.prepare_key is affected because HMAC key guard only recognizes top-level public JWK forms and misses container representations. This occurs when an application allows HMAC and asymmetric algorithms and passes a public JWK container as the raw key. As a result, 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. This issue is fixed in version 2.14.0.
Published: 2026-09-28
Score: 7.4 High
EPSS: < 1% Very Low
KEV: No
Impact: Unauthorized token forgery leading to authentication bypass
Action: Immediate Patch
AI Analysis

Impact

PyJWT’s HMACAlgorithm.prepare_key erroneously accepts a public JWK container as the secret key when the library is used with both HMAC and asymmetric algorithms. The HMAC key guard fails to recognize container representations, allowing public key material to be treated as symmetric secret data. An attacker who can obtain the public key can forge a JWT that carries arbitrary claims and present it to a system that trusts the token. This flaw corresponds to CWE‑347 because the implementation incorrectly validates the key format, enabling an attacker to hijack the token’s authentication logic.

Affected Systems

The vulnerability is present in PyJWT 2.13.x, including 2.13.0 through all 2.13.x releases, and is fixed starting with version 2.14.0. The affected vendor is jpadilla:pyjwt; any Python application that incorporates this library and allows both HMAC and asymmetric algorithms without proper key handling is susceptible.

Risk and Exploitability

The CVSS score of 7.4 indicates a high impact. EPSS is not available, and the vulnerability has not been listed in the CISA KEV catalog, suggesting no reported exploits yet. The attack vector is inferred to be application‑level; an attacker only needs to supply a JWT signed with the compromised public key or manipulate token creation logic. Once a forged token is accepted, the attacker gains the privileges encoded in the token, potentially allowing full system compromise if the token is used for authentication.

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

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade PyJWT to version 2.14.0 or later
  • Restrict token creation to HMAC algorithms when using symmetric keys and disallow public JWK containers as secrets; verify key data before passing to the library
  • Disable support for asymmetric algorithms if not required, or enforce explicit algorithm selection to prevent accidental use of HMAC with a public key container

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-w2cx-738m-mc7w PyJWT accepts public JWK containers as HMAC secrets
History

Tue, 06 Oct 2026 18:45:00 +0000

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

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

Type Values Removed Values Added
Metrics ssvc

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


Tue, 29 Sep 2026 13:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Important


Mon, 28 Sep 2026 23:15:00 +0000

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

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

Type Values Removed Values Added
Description PyJWT is a Python implementation of JSON Web Token standards. From 2.13.0 until 2.14.0, PyJWT HMACAlgorithm.prepare_key is affected because HMAC key guard only recognizes top-level public JWK forms and misses container representations. This occurs when an application allows HMAC and asymmetric algorithms and passes a public JWK container as the raw key. As a result, 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. This issue is fixed in version 2.14.0.
Title PyJWT accepts public JWK containers as HMAC secrets
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'}


Subscriptions

Jpadilla Pyjwt
Pyjwt Project Pyjwt
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-09-29T13:44:49.200Z

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

Link: CVE-2026-102273

cve-icon Vulnrichment

Updated: 2026-09-29T13:44:31.737Z

cve-icon NVD

Status : Analyzed

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

Modified: 2026-10-06T18:29:42.883

Link: CVE-2026-102273

cve-icon Redhat

Severity : Important

Publid Date: 2026-09-28T20:38:28Z

Links: CVE-2026-102273 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-09-28T23:00:07Z

Weaknesses
  • CWE-347

    Improper Verification of Cryptographic Signature