Skip to main content

PyJWT CVE-2026-102272

| EUVDEUVD-2026-88540 HIGH
Improper Verification of Cryptographic Signature (CWE-347)
2026-09-28 GitHub_M GHSA-r6x4-923q-g947
7.4
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain target's public JWK
  2. Delivery
    Prepend UTF-8 BOM to JWK JSON
  3. Exploit
    Sign HS256 token with public key as HMAC secret
  4. Execution
    Submit forged token to mixed-algorithm verify path
  5. Impact
    Authenticate as arbitrary principal

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A04:2025 - Cryptographic Failures
ASVS 5.0
V11 - Cryptography Signature verification
Exploitation Conditions

Exploitation requires all of: the application runs PyJWT 2.13.0 through 2.13.x (fixed in 2.14.0); a mixed-algorithm verification path that permits HMAC (e.g., HS256) alongside asymmetric algorithms; the application passing an asymmetric PUBLIC JWK directly as the raw key argument to HMACAlgorithm.prepare_key rather than loading it via PyJWK/HMACAlgorithm.from_jwk; and the public JWK being prefixed with a UTF-8 byte-order mark (or otherwise BOM/encoding-mangled) so the raw-JWK detector fails to identify it as JSON. The attacker must also know the public key (normally published, so a weak barrier). Limiting factors: this raw-JWK-as-HMAC-secret pattern is a specific and non-default coding choice, which is why the vendor assigned AC:H; correctly-written applications that load JWKs through the provided helpers are not exposed.

Impact

This is a real but conditionally-scoped algorithm-confusion flaw in PyJWT, a ubiquitous Python JWT library. The vendor CVSS 3.1 vector (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N, 7.4 High) correctly captures the shape: network-reachable, no authentication needed by the attacker, but high attack complexity because exploitation depends on a specific and non-default application architecture (mixing HMAC and asymmetric algorithms and feeding a raw public JWK to HMACAlgorithm.prepare_key). All three exploitation signals point AWAY from mass exploitation: no EPSS score is provided, the CVE is NOT in CISA KEV, and no standalone POC is referenced - the only public code is the fix commit and its regression tests (which demonstrate the trigger conditions but are not a weaponized exploit). This is therefore a credible integrity/authentication-bypass defect (token forgery) rather than an actively-exploited priority; the narrow triggering configuration keeps real-world risk LOW-to-MEDIUM despite the product's enormous footprint. One labeling nuance: the CWE (CWE-347, Improper Verification of Cryptographic Signature) and the confidentiality-heavy C:H are debatable - the true primary impact is signature forgery / authentication bypass (integrity), consistent with its sibling PyJWT advisories in the same 2.14.0 release.

Exploit ScenarioDerived

An application verifies JWTs in a mixed-algorithm configuration and, due to a coding pattern, passes an asymmetric public JWK directly as the raw key to the HMAC path. An attacker who already knows the (public, therefore non-secret) key prefixes the JWK JSON with a UTF-8 byte-order mark so PyJWT's raw-JWK detector fails to recognize it as JSON, causing the public key bytes to be used as the HS256 HMAC secret; the attacker then signs a forged token with those known bytes and is authenticated as any user. No public exploit code is identified at time of analysis - only the vendor's fix commit and regression tests exist.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 28, 2026

Token forgery in PyJWT 2.13.x lets unauthenticated remote attackers mint tokens that the library will accept as authentic: when a public JWK is prefixed with a UTF-8 byte-order mark and passed directly as the raw HMAC secret inside a mixed-algorithm verification path, HMACAlgorithm.prepare_key fails to recognize the material as an asymmetric key and uses the publicly known JWK bytes as the shared secret, so anyone who knows the public key can sign arbitrary claims that verify successfully. The flaw carries an assessed CVSS of 7.4 (integrity-only impact, AC:H, PR:N) and per our independent assessment is conditionally scoped: it requires PyJWT 2.13.0 through 2.13.x, an application that permits HMAC alongside asymmetric algorithms, code that hands a raw public JWK to prepare_key instead of loading it via PyJWK/HMACAlgorithm.from_jwk, and BOM-prefixed key material. No public exploit code was identified at time of analysis and the issue is not in CISA KEV; the vendor-released patch is 2.14.0.

RemediationAI

Vendor-released patch: upgrade PyJWT to 2.14.0, the version in which HMACAlgorithm.prepare_key normalizes BOM-prefixed and deeply nested key material before the raw-JWK check; the fix is visible in commit 180783930de91876bc0d601f826a1f2956057291 and the release at https://github.com/jpadilla/pyjwt/releases/tag/2.14.0, with details in advisory GHSA-r6x4-923q-g947. If an immediate upgrade is not possible, the most effective compensating controls are architectural: stop passing raw JWK strings as the key argument and instead load asymmetric keys exclusively through PyJWK or HMACAlgorithm.from_jwk, which perform the correct key-type handling - applications written this way are not exposed; and pin jwt.decode to a single expected algorithm (or a fixed asymmetric-only list) rather than allowing HMAC alongside RSA/EC, which removes the confusion primitive entirely. The trade-off of algorithm pinning is reduced flexibility for multi-issuer deployments that legitimately serve both symmetric and asymmetric tokens, in which case route those issuers through separate verifiers with per-issuer key loaders. As defense in depth, reject or strip BOM-prefixed key material at the configuration boundary and validate that configured secrets are not themselves JSON documents, though note that input sanitization alone is weaker than upgrading because the underlying detection gap remains. Monitor for forged tokens by alerting on HS256 tokens arriving at endpoints that should only accept RS256/ES256, and rotate any HMAC secrets that may have been derived from a public JWK.

Affected VersionsENISA

pyjwt 2.13.0, < 2.14.0

Affected Packages

pypi pyjwt fix: 2.14.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

PyJWT's HMACAlgorithm.prepare_key contains a heuristic that inspects raw key material and rejects anything that looks like a JSON Web Key, because treating an attacker-supplied or public JWK as an HMAC secret is the classic JWT algorithm-confusion attack. The root cause is CWE-347 (Improper Verification of Cryptographic Signature): the detector relied on a simple leading-'{' JSON check that did not account for Unicode byte-order marks or other encoding-mangled input, and it also failed when the decoder raised RecursionError on deeply nested JSON. A key such as a UTF-8 BOM followed by a public RSA JWK therefore slipped past the check, was accepted as an ordinary HMAC secret, and the token was verified under HS256 using that public value - a key the attacker already possesses. The upstream fix in commit 180783930de91876bc0d601f826a1f2956057291 adds a RecursionError fallback that re-decodes the key with json.detect_encoding (which strips/normalizes BOMs) using errors='surrogatepass', then strips leading whitespace before testing for '{', raising InvalidKeyError if the material still looks like a JWK. The accompanying tests parametrize across utf-8, utf-8-sig, utf-16/utf-32 variants and deep nested structures to confirm the detector is no longer bypassable. Because the attack only requires the public key - normally published in a JWKS endpoint - the confidentiality impact is nil while token integrity, and hence authentication and authorization decisions built on those tokens, is fully compromised.

Know when Pyjwt gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 7.4 HIGH
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
vuln.today AI 5.9 MEDIUM

Attacker needs no auth (PR:N) but a specific mixed-algo/raw-JWK config plus BOM manipulation (AC:H); primary impact is token forgery/auth-bypass so I:H, C:N/A:N.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
SUSE HIGH
Red Hat 7.4 HIGH

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

Lifecycle Timeline

2
Patch available
Sep 28, 2026 - 22:02 EUVD
CVE Published
Sep 28, 2026 - 20:36 cve.org
HIGH 7.4

DescriptionCVE.org

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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 196 pypi packages depend on pyjwt (134 direct, 63 indirect)

Ecosystem-wide dependent count for version 2.13.0.

Technical POC Analysis

CWE-347 (Improper Verification of Cryptographic Signature; the advisory was initially filed as CWE-327 and reclassified on 2026-09-10).

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

PyJWT 2.13.x token forgery vulnerability could allow unauthenticated attackers to mint valid tokens under specific conditions. No public exploit identified at time of analysis, but organizations using affected versions in mixed-algorithm verification paths face potential integrity compromise. Leadership should prioritize identifying and patching vulnerable applications to prevent unauthorized access.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.2%
Top 93% exploitable
Prevalence
Ubiquitous
PyJWT is among the most widely used Python JWT libraries
Threat Intel
1
1 sources
Data Quality
8 sources
Confidence: High
EUVD 🇯🇵JVN NVD CVE.org EPSS Vulnrichment GHSA MSRC Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

37
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +37
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

More in Pyjwt

View all
CVE-2026-102266 CRITICAL POC
9.1 Sep 28

Forged HS256 JSON Web Tokens can be accepted as authentic by PyJWT (pip package PyJWT) versions 2.13.0 through 2.13.x wh

CVE-2026-102275 HIGH POC
8.2 Sep 28

Improper validation in PyJWT 2.1.0 through 2.14.0 allows an attacker who already holds a stolen sender-constrained (DPoP

CVE-2026-102274 HIGH POC
7.5 Sep 28

Denial of service in PyJWT 2.9.0 through 2.13.0: a single malformed RSA JWK embedded in a JWK Set aborts construction of

CVE-2026-101918 HIGH POC
7.5 Sep 28

Unauthenticated denial of service in the PyJWT Python library (versions 2.0.0a1 through 2.14.0) allows a remote attacker

CVE-2024-53861 HIGH POC
7.5 Nov 29

pyjwt is a JSON Web Token implementation in Python. Rated high severity (CVSS 7.5), this vulnerability is remotely explo

CVE-2026-48526 HIGH POC
7.4 May 28

Authentication bypass in PyJWT versions prior to 2.13.0 allows remote attackers to forge valid JSON Web Tokens by exploi

CVE-2026-103001 MEDIUM POC
6.5 Sep 30

Reuse of a caller-supplied options mapping in PyJWT 2.11.0 through 2.13.0 can silently leave registered-claim verificati

CVE-2026-102265 MEDIUM POC
5.3 Sep 28

Malformed JSON Web Token headers can cause an uncaught RecursionError in PyJWT 2.13.0 through versions before 2.14.0, re

CVE-2026-48525 MEDIUM POC
5.3 May 28

Uncontrolled resource consumption in PyJWT 2.8.0-2.12.1 exposes any service that verifies detached JWS tokens to unauthe

CVE-2026-102268 CRITICAL
9.1 Sep 28

Signature forgery in PyJWT before 2.14.0 allows an attacker who knows a target's asymmetric public key to forge HMAC-aut

CVE-2026-102267 CRITICAL
9.1 Sep 28

JWKS trust-boundary bypass in PyJWT's PyJWKClient allows a configured trusted JWKS endpoint that returns an HTTP 3xx red

CVE-2026-48524 LOW POC
3.7 May 28

Unconstrained outbound JWKS requests in PyJWT's PyJWKClient.get_signing_key() allow unauthenticated remote attackers to

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Not-Affected
SUSE Linux Enterprise High Performance Computing 12 Not-Affected
SUSE Linux Enterprise Micro 5.5 Not-Affected
SUSE Linux Enterprise Module for Basesystem 15 SP7 Not-Affected
SUSE Linux Enterprise Module for Python 3 15 SP7 Not-Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy