Skip to main content

PyJWT CVE-2026-102268

| EUVDEUVD-2026-88535 CRITICAL
Improper Verification of Cryptographic Signature (CWE-347)
2026-09-28 GitHub_M GHSA-ffc3-869f-jxw9
9.1
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 key
  2. Delivery
    Mutate public-key PEM to evade is_pem_format
  3. Exploit
    Forge HS256 token using public key as HMAC secret
  4. Execution
    Submit token to JWT verification endpoint
  5. Impact
    Bypass authentication as arbitrary identity

Vulnerability Assessment

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

Exploitation requires the target application to (1) use PyJWT prior to 2.14.0, (2) mix HMAC and asymmetric algorithms in verification, and (3) supply an asymmetric public-key PEM as raw key bytes to HMACAlgorithm - a specific and non-default deployment pattern, the same dangerous configuration underlying classic RS256-to-HS256 key confusion. The attacker must additionally know the target's public key (typically obtainable, as it is public) and craft a PEM whose markers evade the pre-fix is_pem_format regex (e.g., a tab before -----END, CR-only line endings, or stripped newlines) while still being accepted by the cryptography loader. Limiting factors: applications that use a single algorithm class, that never treat asymmetric keys as HMAC secrets, or that have upgraded to 2.14.0 are not exploitable; no user interaction or prior authentication is required against a vulnerable configuration.

Impact

This is a genuine algorithm-confusion / signature-forgery flaw (CWE-347) in PyJWT, an extremely widely deployed Python JWT library, so the theoretical blast radius is large. The vendor CVSS3.1 vector (AV:N/AC:L/PR:N/UI:N/C:H/I:H/A:N, 9.1) treats it as trivial remote unauthenticated exploitation, but that overstates real-world ease: exploitation is gated on a specific and non-default application pattern - the app must MIX HMAC and asymmetric algorithms and accept a public-key PEM as raw HMAC key bytes, and the attacker must also craft a mutated PEM that the cryptography loader accepts but is_pem_format did not recognize. That warrants AC:H rather than AC:L, lowering the realistic score to roughly 7.4. No EPSS score, no CISA KEV listing, and no public exploit code were provided, so there is no evidence of active or imminent widespread exploitation - this reads as a high-severity latent risk in vulnerable configurations rather than a mass-exploitation event. Signals are internally consistent (GitHub advisory, fix commit, and release all confirm the same 2.14.0 fix); the main conflict is CVSS complexity (vendor AC:L vs. the description's clearly conditional trigger implying AC:H).

Exploit ScenarioDerived

A web application uses PyJWT and, in the same process, accepts both HMAC-signed and asymmetric-signed tokens, loading a service's public key as raw key bytes. An attacker who knows that public key (public by definition) submits a subtly mutated PEM whose markers is_pem_format fails to detect, causing HMACAlgorithm.prepare_key to use the public key as an HMAC secret, and then forges a validly-'signed' HS256 token to impersonate any user or role. No public exploit code was provided, but the fix commit ships regression tests that demonstrate the mutations (tab before END, CR line endings, stripped newlines).

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
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 before 2.14.0 allows an attacker who knows a target's asymmetric public key to forge HMAC-authenticated JWTs when the application mixes HMAC and asymmetric algorithms and passes asymmetric public-key PEM bytes into HMAC verification. The flaw is in is_pem_format in jwt/utils.py, which fails to recognize all PEM formatting variants accepted by the cryptography loader, causing HMACAlgorithm.prepare_key to treat a mutated public-key PEM as an HMAC secret. Exploitation requires a specific non-default deployment pattern-mixed algorithm verification with raw PEM key bytes-and the assessed CVSS vector is AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N; no public exploit identified at time of analysis, and no CISA KEV status was provided.

RemediationAI

Upgrade PyJWT to 2.14.0, the vendor-released patch that fixes is_pem_format (release: https://github.com/jpadilla/pyjwt/releases/tag/2.14.0; advisory: https://github.com/jpadilla/pyjwt/security/advisories/GHSA-ffc3-869f-jxw9). If immediate upgrade is not possible, stop mixing HMAC and asymmetric algorithms in the same verification path: explicitly restrict jwt.decode to one algorithm family, such as RS256 only or HS256 only, and never select the accepted algorithm from the untrusted token header. Ensure HMAC secrets are random shared secrets and never asymmetric public-key PEM bytes; reject any HMAC key that contains PEM markers, and keep separate key sets/configurations for HMAC and asymmetric verification. These compensating controls can break legitimate multi-algorithm deployments and require careful configuration, but they remove the key-confusion precondition; upgrading to 2.14.0 is the only complete fix confirmed by the vendor.

Affected VersionsENISA

pyjwt < 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 widely used Python library for JSON Web Token (JWT) signing and verification. JSON Web Tokens use either HMAC (HS256/HS384/HS512) with a shared secret or asymmetric algorithms (RS/ES/PS) with public/private keys; safe libraries must never allow an asymmetric public key to be used as an HMAC secret, because that enables the classic RS256-to-HS256 key-confusion attack. CVE-2026-102268 is CWE-347 (Improper Verification of Cryptographic Signature). The root cause is that jwt/utils.py's is_pem_format used a regular expression that did not match every PEM representation the cryptography loader accepts-e.g., a tab before -----END, CR-only line endings, or stripped newlines. In a vulnerable application that mixes algorithm families and supplies a public-key PEM as raw bytes to HMACAlgorithm.prepare_key, the malformed PEM bypassed is_pem_format and was accepted as an HMAC key; an attacker knowing the public key could then compute a valid HMAC and forge a token. The 2.14.0 fix replaces the regex with marker-pairing logic that recognizes loader-accepted PEM variants while retaining explicit asymmetric-key marker rejection, as shown in commit 8b4e233a22206b34ec1186e912e75c0b2396ac07 and tests covering mutated PEM markers.

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 9.1 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
vuln.today AI 7.4 HIGH

Network token submission needs no auth (PR:N/AV:N), but the vulnerable mixed-algorithm config plus crafting a loader-accepted mutated PEM raises complexity to AC:H; forgery breaks integrity/auth with data-access confidentiality impact, no availability effect.

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 7.4 HIGH
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Red Hat 9.1 CRITICAL

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
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:26 cve.org
CRITICAL 9.1

DescriptionCVE.org

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.

Blast Radius

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

Ecosystem-wide dependent count for version 2.14.0.

Technical POC Analysis

Bug class: CWE-347, improper verification of cryptographic signature, through an algorithm-confusion guard bypass.

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, a widely used Python library for issuing and validating JSON Web Tokens, contains a critical signature-forgery flaw that can allow an attacker holding an application's public key to mint tokens the application will accept as authentic, effectively bypassing authentication. The exposure is concentrated in services that mix HMAC and asymmetric verification and pass raw public-key PEM bytes into the HMAC path - a specific, non-default but not uncommon integration pattern in older authentication code. Because successful forgery grants the attacker whatever identity and privileges the forged token claims, any product or platform relying on affected PyJWT deployments for session or API authentication should be treated as a potential authentication-bypass risk until remediated.

Business Impact: High
Compensating Controls

No vendor-released patch is confirmed in the provided context, so apply interim mitigations: pin an explicit algorithms allowlist on every jwt.decode call so tokens can never self-select HMAC when the service expects asymmetric signatures; never pass raw PEM public-key bytes as a verification key - pass a cryptography key object instead; separate HMAC and asymmetric verification into distinct services or code paths that do not share key material; rotate any HMAC secret that was derived from or stored alongside asymmetric public keys; and monitor authentication logs for algorithm/header mismatches, unexpected token issuers, or tokens validating against a key family the service does not intend to use. Reassess and apply the vendor fix as soon as an official patched version is published.

Threat Intelligence Overview

EPSS Score
0.2%
Top 92% exploitable
Prevalence
High
PyJWT is one of the most widely used Python JWT libraries
Threat Intel
1
1 sources
Social Media
2
Sightings
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 CRITICAL
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
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
Yes
Human Impact
High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
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-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

CVE-2026-101917 HIGH
7.5 Sep 28

Unauthenticated attackers can amplify outbound HTTP traffic from any application that validates JWTs with PyJWT's PyJWKC

Vendor StatusVendor

SUSE

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

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