Skip to main content
Vulnerability Database/CVE-2026-102269

CVE-2026-102269: PyJWT Authentication Bypass Vulnerability

CVE-2026-102269 is an authentication bypass vulnerability in PyJWT that allows signature segment manipulation through non-canonical Base64URL characters. This article covers technical details, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-102269 Overview

CVE-2026-102269 affects PyJWT, a Python implementation of the JSON Web Token (JWT) standards. The vulnerability exists in versions prior to 2.14.0. The base64url_decode function accepts characters outside the canonical Base64URL alphabet when processing the signature segment of a compact JSON Web Signature (JWS). Appending non-Base64URL characters to a valid signature segment produces identical signature bytes across different serialized token forms. This breaks raw-token revocation checks because an equivalent modified token is not recognized as the revoked original. The maintainers addressed the issue in PyJWT 2.14.0.

Critical Impact

An attacker can bypass raw-token revocation checks by appending non-canonical characters to the signature segment, producing a functionally equivalent token that evades denylist matching.

Affected Products

  • PyJWT versions prior to 2.14.0
  • Python applications using PyJWT for JWT signature validation
  • Services performing raw-token revocation checks with PyJWT

Discovery Timeline

  • 2026-09-28 - CVE-2026-102269 published to NVD
  • 2026-09-30 - Last updated in NVD database

Technical Details for CVE-2026-102269

Vulnerability Analysis

The flaw resides in PyJWT's handling of the compact JWS signature segment. The Base64URL alphabet is strictly defined as A-Z, a-z, 0-9, -, and _. PyJWT's decoder tolerated characters outside this set when decoding the signature segment. This tolerance produced multiple valid serialized token strings that decoded to the same signature bytes.

Applications that maintain a denylist of revoked raw token strings compare the exact serialized form. An attacker who obtains a valid token can modify the signature segment with non-canonical characters. The modified token verifies successfully but does not string-match the revoked entry. The issue is tracked under [CWE-180: Incorrect Behavior Order: Validate Before Canonicalize].

Root Cause

The decoder path did not enforce the canonical Base64URL alphabet before decoding. Verification consumed the decoded bytes, which were identical for canonical and non-canonical inputs. Revocation logic, which typically operates on the raw serialized token, therefore lost its uniqueness guarantee.

Attack Vector

Exploitation requires an attacker to already possess a valid JWT — for example, a token that has been issued and later revoked. The attacker appends or substitutes characters in the signature segment that fall outside the Base64URL alphabet. The tampered token still passes signature verification in vulnerable PyJWT versions. Because the raw string differs from the revoked token, denylist-based revocation fails to reject it.

python
     from .types import SigOptions
 
 _ALGORITHM_UNSET = object()
+_BASE64URL_ALPHABET = (
+    b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
+)
 
 
 class PyJWS:

Source: GitHub Commit e6f4840 — the patch introduces an explicit Base64URL alphabet constant used to reject non-canonical compact JWS segments.

Detect Identity Attacks the Moment Authentication Fails

Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.

Stop Identity Attacks

Detection Methods for CVE-2026-102269

Indicators of Compromise

  • JWT signature segments containing characters outside the Base64URL alphabet (A-Z, a-z, 0-9, -, _).
  • Multiple authentication events using tokens with identical decoded signatures but differing raw string forms.
  • Successful API calls with tokens matching the hash of a previously revoked token but not its exact string.

Detection Strategies

  • Log the raw JWT signature segment and flag any request where the segment contains characters not in the canonical Base64URL alphabet.
  • Compare revocation lookups by decoded signature bytes as a secondary check alongside raw string matching.
  • Inventory Python dependencies to identify services running PyJWT versions earlier than 2.14.0.

Monitoring Recommendations

  • Monitor authentication and API gateways for tokens whose signature segment length or character set deviates from prior sessions for the same subject.
  • Alert on reuse of a revoked subject or jti claim, regardless of raw token string equality.
  • Track PyJWT version telemetry from software composition analysis tooling and correlate with production traffic.

How to Mitigate CVE-2026-102269

Immediate Actions Required

  • Upgrade PyJWT to version 2.14.0 or later across all Python services and container images.
  • Audit revocation logic to ensure it operates on canonical or hashed token representations rather than raw serialized strings alone.
  • Rotate any secrets or tokens that may have been affected by revocation bypass in high-value systems.

Patch Information

The fix is available in PyJWT release 2.14.0. The change enforces the canonical Base64URL alphabet during compact JWS segment decoding, as documented in GHSA-hxm8-2xgr-2p9m. Applications should pin pyjwt>=2.14.0 in dependency manifests.

Workarounds

  • Validate the signature segment against the Base64URL alphabet regex ^[A-Za-z0-9_-]+$ before invoking PyJWT decode routines.
  • Store and compare revoked tokens by their SHA-256 digest of the decoded signature bytes rather than the raw token string.
  • Enforce short token lifetimes and rely on issuer-side session invalidation to reduce the exposure window.
bash
# Upgrade PyJWT to a fixed version
pip install --upgrade 'pyjwt>=2.14.0'

# Verify the installed version
python -c "import jwt; print(jwt.__version__)"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.