Skip to main content

PyJWT CVE-2026-102271

| EUVDEUVD-2026-88539 HIGH
Improper Verification of Cryptographic Signature (CWE-347)
2026-09-28 GitHub_M GHSA-p4g4-x82p-q773
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 key (DER)
  2. Delivery
    Craft HS256 token signed with DER bytes as HMAC secret
  3. Exploit
    Submit forged token to endpoint accepting mixed algorithms
  4. Execution
    prepare_key uses public DER as HMAC key, signature verifies
  5. Impact
    Impersonate user / bypass authentication

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: (1) the application configures PyJWT to accept BOTH HMAC and asymmetric algorithms (the classic algorithm-confusion precondition); (2) the application supplies a DER-encoded public key (SubjectPublicKeyInfo, PKCS1, or a DER x509 certificate) as the shared verification key rather than a PEM/SSH-formatted key - PEM and SSH keys were already caught by the pre-existing textual guard; and (3) the attacker knows the public key (which, being public, is a low bar). Affected versions are PyJWT 2.4.0 through 2.13.x (fixed in 2.14.0), and the 'cryptography' backend must be installed (has_crypto) for the DER path. Limiting factors: this is a non-default, application-specific misconfiguration - apps that pin a single algorithm or that pass PEM keys are not exploitable - which is why AC is High despite no authentication or user interaction being required.

Impact

This is a genuine but conditionally-triggered signature-forgery / algorithm-confusion flaw (CWE-347), not a high-CVSS-but-low-impact issue in the abstract - yet its real-world reachability is narrow. The vendor CVSS 3.1 vector (AV:N/AC:H/PR:N/UI:N/C:H/I:H/A:N, 7.4) correctly captures the key trade-off: network-reachable and unauthenticated (PR:N) because an attacker who knows the public key can forge tokens, but AC:H because exploitation depends on a specific application misconfiguration - the app must mix HMAC and asymmetric algorithms AND supply a DER-encoded public key as the shared verification secret. There is no EPSS score, no CISA KEV listing, and no public exploit code provided, so exploitation status is 'no public exploit identified at time of analysis' - this is a design/logic weakness disclosed with a fix, not an actively-exploited threat. The signals are consistent (no conflict): moderate severity, ubiquitous library, but a non-default trigger condition. Note the input tag 'Information Disclosure' conflicts with the actual impact - this is token forgery / authentication bypass (integrity), not information disclosure. This is the DER-encoding counterpart of the sibling PEM-marker flaw (GHSA-ffc3-869f-jxw9); both stem from HMACAlgorithm.prepare_key's asymmetric-key guard relying on textual key markers.

Exploit ScenarioDerived

An application configured to accept both HMAC (HS256) and asymmetric (RS256) algorithms loads an RSA public key in DER form and passes those raw bytes as the verification key. Because PyJWT's textual PEM/SSH marker check does not detect DER encoding, PyJWT treats the public DER bytes as an HMAC secret; an attacker who already knows the (public) key crafts an HS256 token signed with those same bytes and it verifies as authentic, forging arbitrary authenticated claims. No public proof-of-concept was provided, though the fix commit ships regression tests demonstrating the rejected DER key/certificate cases.

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 the PyJWT Python library (versions 2.4.0 through 2.13.x) lets a remote, unauthenticated attacker mint forged HMAC tokens whenever an application is misconfigured to accept both HMAC and asymmetric algorithms and passes a DER-encoded public key as the shared verification secret. PyJWT's HMACAlgorithm.prepare_key only rejected PEM- and SSH-formatted asymmetric keys using textual markers, so a DER public key (SubjectPublicKeyInfo, PKCS1, or a DER x509 certificate) slipped through and its public bytes were used directly as the HMAC secret - meaning anyone who knows the public key can sign valid tokens. The flaw is rated CVSS 7.4 with High attack complexity precisely because it requires that specific non-default application configuration; no public exploit code has been identified at time of analysis, and the vendor-released patch is PyJWT 2.14.0.

RemediationAI

Vendor-released patch: upgrade PyJWT to version 2.14.0, which adds the _is_der_key() check that rejects DER public keys and DER x509 certificates passed to HMACAlgorithm.prepare_key (see https://github.com/jpadilla/pyjwt/releases/tag/2.14.0 and advisory https://github.com/jpadilla/pyjwt/security/advisories/GHSA-p4g4-x82p-q773). Where an immediate upgrade is not possible, the most effective compensating control is to eliminate the algorithm-confusion precondition: pass an explicit, single-algorithm 'algorithms' list to jwt.decode (for example algorithms=['RS256'] for token verification, or algorithms=['HS256'] for symmetric-only deployments) and never allow HMAC and asymmetric algorithms to coexist in the same verification path; this fully blocks the attack at the cost of requiring callers to know and hard-code the expected algorithm, which breaks any legitimate multi-algorithm or key-rotation setups that rely on mixing families. A second control is to configure verification keys as PEM- or SSH-formatted material, since those encodings were already rejected by the pre-existing textual guard - but this is a fragile defense because it depends on input formatting rather than the fix's structural DER parsing. Note that the 2.14.0 guard will raise InvalidKeyError for DER keys previously (mis)used as HMAC secrets; any deployment that intentionally relied on that behavior must migrate to a properly generated high-entropy symmetric secret, otherwise token issuance/verification will begin failing after upgrade.

Affected VersionsENISA

pyjwt 2.4.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

The root cause is CWE-347 (Improper Verification of Cryptographic Signature), realized as a classic algorithm-confusion weakness in PyJWT's cryptographic backend abstraction. PyJWT supports both symmetric HMAC algorithms (HS256/384/512) and asymmetric algorithms (RS*, ES*, PS*), and the library's Algorithm subclasses are selected by the caller-supplied 'algorithms' list or the token header. HMACAlgorithm.prepare_key previously refused asymmetric material by checking only textual encodings - is_pem_format() (looking for '-----BEGIN ... -----' armor) and is_ssh_key() (looking for 'ssh-rsa'/'ecdsa-sha2-' style prefixes). DER-encoded keys carry none of those ASCII markers, so a DER public key or DER x509 certificate was accepted as an HMAC secret and used byte-for-byte as the MAC key. Because a public key is by definition non-secret, an attacker who obtains it can compute the identical HMAC and forge tokens that the application will validate successfully. The fix in commit 2798504fa2663364573cf2d1043d8d7fef389499 introduces a static _is_der_key() helper that attempts cryptography's load_der_public_key() and x509.load_der_x509_certificate(); if either parses, the key is treated as asymmetric and rejected with InvalidKeyError. This path only activates when the optional 'cryptography' backend is installed (has_crypto), so deployments without cryptography were never reachable via the DER branch. Notably, the fix deliberately preserves acceptance of ordinary binary HMAC secrets that merely begin with DER-like bytes (e.g. b'\x30\x82not-a-der-key'), avoiding a false-positive regression for legitimate random secrets.

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

Network-reachable and unauthenticated (PR:N) since only the public key is needed, but AC:H because it depends on a mixed-algorithm + DER-key-as-secret misconfiguration; forged tokens grant impersonation so C:H/I:H, no availability impact.

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:31 cve.org
HIGH 7.4

DescriptionCVE.org

PyJWT is a Python implementation of JSON Web Token standards. From 2.4.0 until 2.14.0, PyJWT HMACAlgorithm.prepare_key is affected because asymmetric-key guard relies on textual markers that are absent from DER encoding. This occurs when an application mixes HMAC and asymmetric algorithms and supplies a DER public key as the shared verification key. As a result, PyJWT uses public DER bytes 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
  • 275 pypi packages depend on pyjwt (199 direct, 76 indirect)

Ecosystem-wide dependent count for version 2.4.0.

Technical POC Analysis

CWE-347 (Improper Verification of Cryptographic Signature), specifically the classic JWT "key confusion" pattern that CVE-2022-29217 was filed for, re-reachable through a different key encoding.

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

A signature-forgery flaw in the PyJWT Python library (versions 2.4.0 through 2.13.x), widely used by Python services to issue and verify authentication tokens, could allow an attacker to mint tokens that pass verification and impersonate users or services wherever an application has been misconfigured to accept both symmetric and asymmetric algorithms against the same key material. Exposure is bounded by that specific non-default configuration, so the practical blast radius is limited to teams that have not pinned an explicit algorithm allowlist - but for those teams the consequence is a direct break in the authentication trust boundary that underpins session management and access control. Leadership should treat this as a high-priority remediation item for any internet-facing service that relies on PyJWT to gate access.

Business Impact: High
Compensating Controls

Apply vendor patch: upgrade to PyJWT 2.14.0. Until the upgrade is complete, enforce an explicit algorithm allowlist in every jwt.decode call so HMAC and asymmetric algorithms are never accepted together; reject DER-encoded keys (PKCS1, SubjectPublicKeyInfo, or DER x509 certificates) and any key material supplied as a verification secret that does not match the expected algorithm family; validate that the configured key type aligns with the expected signing algorithm; and monitor and rotate any signing keys or shared secrets reachable by a misconfigured verifier.

Threat Intelligence Overview

EPSS Score
0.2%
Top 94% exploitable
Prevalence
High
PyJWT is a very widely used Python JWT library across web/API auth stacks
Threat Intel
1
1 sources
Data Quality
7 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 Affected
SUSE Linux Enterprise High Performance Computing 12 Not-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