Skip to main content

PyJWT CVE-2026-102273

| EUVDEUVD-2026-88541 HIGH
Improper Verification of Cryptographic Signature (CWE-347)
2026-09-28 GitHub_M GHSA-w2cx-738m-mc7w
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 / JWKS
  2. Delivery
    Craft HS256 token with forged claims
  3. Exploit
    Sign using public key as HMAC secret
  4. Execution
    Submit token to verification endpoint
  5. Persist
    Guard misses container form, HMAC verify passes
  6. Impact
    Authenticate as arbitrary/privileged identity

Vulnerability Assessment

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

Exploitation requires a specific, non-default application design: the app must (1) be running PyJWT 2.13.0, (2) permit both HMAC (e.g. HS256) and asymmetric (RS256/ES256) algorithms in its verification allow-list, and (3) pass a PUBLIC JWK CONTAINER - a JWKS document ({"keys":[...]}), a bare array ([jwk]), a nested array ([[jwk]]), or a BOM-prefixed variant - directly as the raw key to verification, rather than an individual key object. The attacker must also know the target's public key (usually not secret). Limiting factors: the 2.13.0 guard already blocks top-level JWK forms, so only the container wrappers slip through; applications that decode with a single algorithm, use PyJWK/PyJWKClient objects, or supply proper symmetric secrets are unaffected. AC:H reflects these combined preconditions; no user interaction or authentication is needed for the attacker.

Impact

This is a genuine authentication-bypass / signature-forgery flaw (CWE-347) but with a narrow trigger, so it sits below its 7.4 headline score in real-world urgency. The CVSS vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N is internally consistent with the description: no privileges are needed to forge a token, but AC:H correctly reflects the multiple preconditions (the application must be configured to accept both HMAC and asymmetric algorithms AND must pass a public JWK container directly as the raw verification key, and the attacker must know the public key). There is no EPSS score, no CISA KEV listing, and no public exploit code identified in the provided intelligence - so no signal indicates active or automatable exploitation; this is a code-audited advisory-and-commit disclosure, not an observed-in-the-wild threat. The commit and dedicated regression tests (JWKS wrappers, nested arrays, BOM prefix, oversized-integer/deep-array cases) confirm the root cause with high fidelity. Bottom line: real and worth patching for anyone on the affected release, but a targeted design-dependent bug rather than a broadly exploitable one.

Exploit ScenarioDerived

An application on PyJWT 2.13.0 configures verification to allow both HMAC and RSA/EC algorithms and passes a public JWK container (e.g. a JWKS document {"keys":[...]} or a bare/nested array wrapping a public JWK) as the raw key. Because the 2.13.0 public-key guard only inspected top-level JWK forms, the public key material is accepted as an HMAC secret; an attacker who knows that public key crafts an HS256 token signed with it and injects arbitrary authenticated claims (identity/role). No exploit code is published, and exploitation complexity is high (AC:H) given the specific configuration required.

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

Signature forgery in PyJWT 2.13.0 lets an attacker forge arbitrary JWT claims when an application verifies tokens using both HMAC and asymmetric algorithms and hands a public JWK container (a JWKS document, a bare array, a nested array, or a BOM-prefixed variant) directly to the library as the raw key. Because the version 2.13.0 HMAC key guard only recognizes top-level public JWK objects and misses these container wrappers, public asymmetric key material - which is not secret - is accepted as the HMAC secret, so anyone who knows the target's public key can sign a token with any claims and have it validate. The flaw is an improper-signature-verification issue (CWE-347) rated CVSS 3.1 7.4 (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N) and unauthenticated in the sense that no credentials are needed, but real-world urgency is lower than the headline score: exploitation requires a non-default application design that mixes algorithm families and passes container-form keys, and no public exploit code or confirmed active exploitation was identified at time of analysis. Vendor-released patch: PyJWT 2.14.0.

RemediationAI

Upgrade PyJWT to version 2.14.0 or later - the only vendor-released fix, addressed by commit 801cd128528c62d9b23fcd161d1a2e1c17982f95 and published as release 2.14.0 - using pip install --upgrade 'pyjwt>=2.14.0' and pinning the floor in requirements.txt/pyproject.toml (also verify transitive dependents such as auth SDKs and API gateways do not hold the library back); see the advisory at https://github.com/jpadilla/pyjwt/security/advisories/GHSA-w2cx-738m-mc7w. Where immediate upgrade is not possible, the most effective compensating control is to never allow algorithm mixing: pass an explicit single-family allow-list to jwt.decode, for example algorithms=["RS256"] or algorithms=["HS256"], which removes the confusion path entirely and is safe because legitimate tokens from a given issuer use one family, though it will break any legacy flow that expects multiple algorithms from the same verifier and may require per-issuer decoding rules. Second, stop passing raw JWK containers as keys: resolve keys through PyJWK/PyJWKClient and pass the individual key object, or fetch and index the JWKS document yourself and select the matching "kid", which keeps key material in the intended form (minor refactor, no functional loss). Third, for HMAC verifiers, supply the actual shared symmetric secret rather than any JSON blob. Note that patched versions also reject JWK-shaped strings that are legitimate deep-array secrets only when a "kty" member is present, so testing after upgrade is advised for unusual key formats; no KEV or public exploit code was identified, so these changes can be scheduled as a normal high-priority maintenance item rather than an emergency, but they should not be deferred given the authentication-bypass nature of the flaw.

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 is a Python implementation of JSON Web Token (JWT) standards, and the vulnerable code lives in HMACAlgorithm.prepare_key within jwt/algorithms.py. JSON Web Keys (JWKs) are dictionaries carrying a "kty" (key type) member, and JWKS documents wrap one or more JWKs in a {"keys": [...]} container; applications commonly fetch such documents from a provider's JWKS endpoint and may inadvertently pass the whole container as the signing/verification key. Prior hardening in 2.13.0 only rejected keys that were themselves top-level JWK objects (a JSON object with a "kty" member), so an attacker-supplied or application-supplied container such as {"keys":[public_jwk]}, [public_jwk], [[public_jwk]], or a UTF-8-BOM-prefixed JWKS slipped past the guard and was treated as raw HMAC key bytes. This is the classic algorithm-confusion (key-confusion) attack: when a verifier's allow-list contains both HS* and RS*/ES*/PS* algorithms, an attacker sets the token header to HS256 and signs it with the target's public key, which the library then uses as the symmetric secret. The upstream fix (commit 801cd128528c62d9b23fcd161d1a2e1c17982f95) makes detection recursive, walking nested dicts and lists for a "kty" member via an iterative stack, strips leading BOM and whitespace before the structural check, scans the raw text for a "kty" member even inside arrays by tokenizing quoted strings followed by a colon, and adds json.loads(..., parse_int=lambda _: 0) to neutralize oversized-integer denial-of-service inputs. The accompanying tests cover jwks, array, nested-array, BOM-prefixed, 20,000-level-deep array, escaped-\u006bty, oversized-integer, and a legitimate deep-array secret containing the literal string "kty" that must still be accepted.

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 7.4 HIGH

AC:H because exploitation needs a specific HMAC+asymmetric config passing a JWK container as raw key; PR:N/UI:N since forging a token needs only the public key; C:H/I:H from full claim forgery.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/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:38 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, 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.

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 a cryptographic signature.

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.0, a widely used Python library for validating JSON Web Tokens, contains a signature-forgery flaw that lets an attacker mint tokens with arbitrary claims using only an application's public key. Any service that authenticates users or workloads via PyJWT and mixes HMAC with asymmetric algorithms while passing a JWKS container directly to the library is exposed to authentication and privilege-escalation bypass. No vendor patch is currently available and no public exploit code has been identified at time of analysis, so exposure is confined to organizations whose token-validation code follows that non-default pattern.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: never pass a JWKS document, bare JWK array, nested array, or BOM-prefixed variant as the raw key to PyJWT; resolve keys via PyJWKClient/PyJWKSet and supply a single key object; set the algorithms parameter to exactly one expected algorithm and reject tokens whose header alg does not match; keep HMAC secrets and asymmetric public keys in separate code paths and configuration so public key material can never be used as an HMAC secret; validate that the resolved key type and family match the expected algorithm; strip BOM and whitespace before parsing; and alert on anomalous signature-verification failures and on tokens signed with an unexpected algorithm. Vulnerability is unauthenticated per the CVSS vector (PR:N); exploitation requires a non-default application design that mixes algorithm families and passes container-form keys, and no public exploit identified at time of analysis.

Threat Intelligence Overview

EPSS Score
0.2%
Top 94% exploitable
Prevalence
Ubiquitous
PyJWT is the de facto standard JSON Web Token library across Python applications
Threat Intel
1
1 sources
Data Quality
7 sources
Confidence: High

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
None
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