CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-102266

CVE-2026-102266: Signature Verification Bypass in PyJWT via Empty JWK

Alon Barad
Alon Barad
Software Engineer

Sep 30, 2026·8 min read·36 visits

Executive Summary (TL;DR)

PyJWT versions 2.13.0 to 2.14.0 fail to validate key lengths on PyJWK paths, allowing attackers to forge tokens with an empty HMAC key if a trusted JWK contains an empty 'k' parameter.

A signature verification bypass vulnerability in PyJWT allows unauthenticated remote attackers to forge JSON Web Tokens when processing JSON Web Key Sets containing an empty symmetric key.

Vulnerability Overview

CVE-2026-102266 represents a signature verification bypass vulnerability in PyJWT, a prominent Python library implementing JSON Web Token (JWT) and JSON Web Signature (JWS) standards. The flaw specifically affects PyJWT versions 2.13.0 up to, but not including, 2.14.0. The bug resides within the signature validation pathway for tokens verified using JSON Web Keys (JWKs) or JSON Web Key Sets (JWKS). Under specific configurations, this allows an unauthenticated remote attacker to bypass cryptographic trust controls and forge arbitrary JWT assertions.

The failure is located in the key handling discrepancy between raw cryptographic keys and keys encapsulated within a PyJWK object. When PyJWT decodes a token using a raw key, it executes input validation checks to prevent the use of weak or empty keys. However, when parsing and processing keys extracted from a PyJWK instance, the verification pipeline bypassed these validation steps. This architectural oversight allowed the verification process to execute using an empty byte-string secret key when a trusted JWK structure contained empty material.

Because the library defaulted to raising warnings instead of exceptions for inadequate key lengths, the verification function proceeded to calculate and validate signatures using an empty HMAC key. Consequently, if an application relies on a JWK Set containing a symmetric key with an empty representation, an offline attacker can construct a valid signature using a null-byte key. This results in complete validation bypass, granting the attacker the ability to inject arbitrary claims and assume unauthorized identities within the application context.

Root Cause Analysis

The root cause of CVE-2026-102266 lies in the dual-path design of the key validation logic inside PyJWT. Historically, PyJWT implemented a validation pipeline for raw cryptographic keys through the prepare_key method of individual algorithm classes. For HMAC algorithms, this method verified that the key length was non-zero and threw an InvalidKeyError if an empty key was provided. This safe-default behavior ensured that any attempt to initialize an HMAC verification operation with a blank key would fail immediately prior to execution.

In contrast, when the verification pipeline utilized a PyJWK key representation (often dynamically resolved from JWK Sets), the code bypassed this central validation checkpoint. Instead of invoking the algorithm's specialized prepare_key method, the JWS verification layer directly retrieved the raw internal key buffer from the PyJWK object. If the source JWK entry was a symmetric oct key with an empty k parameter, the Base64URL decoding mechanism parsed this parameter into an empty byte string b"" without triggering any initialization errors.

This dual-path vulnerability was compounded by the default handling of key length violations within PyJWT. When the enforce_minimum_key_length configuration option is disabled, which is the default setting, the library only emits an InsecureKeyLengthWarning instead of raising an exception when encountering extremely short keys. Because the empty key path did not trigger an upfront validation failure, the verification function continued its execution path, comparing the incoming signature against an HMAC value generated with a zero-length secret key.

Code Analysis

To understand the mechanics of the vulnerability, we analyze the key loading and signature validation files. The code block below contrasts the vulnerable key loading path in jwt/api_jws.py with the corrected implementation of version 2.14.0. Prior to the fix, the validation logic directly extracted the internal raw key representation from the PyJWK object without invoking the algorithm-specific key preparation logic.

# Vulnerable code in PyJWS._verify_signature (jwt/api_jws.py)
alg_obj = key.Algorithm
prepared_key = key.key  # Bypasses prepare_key validation entirely
 
# Patched code in PyJWS._verify_signature (jwt/api_jws.py)
alg_obj = key.Algorithm
prepared_key = alg_obj.prepare_key(key.key)  # Core Fix: apply prepare_key checks

By replacing key.key with alg_obj.prepare_key(key.key), the patch ensures that any key resolved from a PyJWK context is forced through the same validation checks as a raw key, causing the library to throw an InvalidKeyError if the key length is zero.

The secondary patch acts as a defense-in-depth measure within the JWK parser in jwt/algorithms.py. When an HMAC key is loaded via the from_jwk interface, the updated logic validates the length of the decoded key material before creating the internal representation. If the decoded byte sequence is empty, the parser raises an InvalidKeyError during key initialization, preventing the creation of a vulnerable PyJWK instance entirely.

# Patched code in HMACAlgorithm.from_jwk (jwt/algorithms.py)
key_bytes = base64url_decode(obj["k"])
if len(key_bytes) == 0:
    raise InvalidKeyError("HMAC key must not be empty.")  # Prevent loading empty oct keys
return key_bytes

Exploitation Mechanics

Exploitation of CVE-2026-102266 requires specific environmental criteria but presents a low attack complexity once those criteria are met. The target application must process token signatures using keys retrieved from a JSON Web Key Set (JWKS). Crucially, the JWKS must contain an oct key with an empty key parameter "k": "". This condition often arises in testing environments, misconfigured directory services, or situations where keys are populated from uninitialized databases.

Once an empty oct key is present in the active JWKS, the attacker can execute the exploit completely offline. The attacker constructs a JWT payload with administrative privileges or desired claims, referencing the identifier (kid) of the empty key in the header. The attacker then generates an HMAC-SHA256 signature using a zero-length byte string (b"") as the secret key. The resulting base64url-encoded signature is appended to the token header and payload.

The following test script demonstrates how the signature generation is constructed and demonstrates how vulnerable versions of PyJWT accept the forged token, while patched versions throw an exception:

import base64
import hashlib
import hmac
import jwt
 
def test_exploit():
    empty_jwk = {
        "kty": "oct",
        "k": "",
        "kid": "active",
        "alg": "HS256"
    }
    jwk_obj = jwt.PyJWK.from_dict(empty_jwk)
    signing_input = b"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhdHRhY2tlciJ9"
    signature_bytes = hmac.new(b"", signing_input, hashlib.sha256).digest()
    encoded_signature = base64.urlsafe_b64encode(signature_bytes).rstrip(b"=")
    token = (signing_input + b"." + encoded_signature).decode()
    
    try:
        decoded = jwt.decode(token, jwk_obj, algorithms=["HS256"])
        print("Verification Succeeded: " + str(decoded))
    except jwt.InvalidKeyError as e:
        print("Verification Blocked: " + str(e))

Impact Assessment

The impact of CVE-2026-102266 is high because it allows complete authentication and authorization bypass. An attacker who successfully exploits this vulnerability can forge valid cryptographic signatures representing any user identity, including administrative accounts. In typical deployments where JWTs are used to transmit authorization claims, this enables unauthorized privilege escalation, complete data access, and administrative control over the affected application.

The National Vulnerability Database assigns this vulnerability a CVSS score of 7.4. The vector string is CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N. The attack vector is Network, indicating remote exploitation capability. The complexity is High because of the prerequisite that the trust store contains an empty key. Confidentially and integrity impacts are both rated High, as arbitrary operations can be performed on behalf of simulated user sessions.

Although no active in-the-wild exploitation has been recorded by CISA or threat intelligence networks, the availability of clear proof-of-concept material increases the threat profile. Software developers and operations teams must prioritize remediation, particularly in multi-tenant environments where JWK Sets are dynamically fetched or managed by tenant-controlled identity providers.

Remediation and Mitigation

The primary remediation strategy is upgrading the PyJWT library to version 2.14.0 or higher. This version integrates the dual fixes that enforce strict key length validations on the PyJWK verification path and block empty HMAC keys during dynamic JWK parsing. The update is backwards-compatible and can be applied through python package managers using standard commands such as pip install --upgrade pyjwt.

When immediate upgrading is not feasible, several defensive workarounds can be applied at the application or gateway layer. Security teams should enforce key length validations by explicitly passing the enforce_minimum_key_length configuration option as True during token decoding. This ensures that even if an empty key bypasses the initial check, the signature validation phase raises an error due to the insufficient key length.

Additionally, applications that ingest remote JWK Sets should sanitize incoming keys. The sanitization logic must inspect the key list and explicitly reject any oct key where the k parameter is absent, null, or is an empty string. This preventative step blocks the entry of the vulnerable condition into the active key memory, mitigating the root cause of the signature bypass.

Technical Appendix

CVSS Score
7.4/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
EPSS Probability
0.18%
Top 94% most exploited

Affected Systems

pyjwt (Python implementation of JSON Web Token)
AttributeDetail
CWE IDCWE-347
Attack VectorNetwork (AV:N)
CVSS7.4
EPSS0.00175
ImpactAuthentication Bypass / Privilege Escalation
Exploit StatusProof-of-Concept
KEV StatusNot Listed
CWE-347
Improper Verification of Cryptographic Signature

The software imports or uses a cryptographic key or signature but does not verify or improperly verifies the signature, allowing attackers to bypass authentication or integrity checks.

Vulnerability Timeline

PyJWT 2.13.0 is released, introducing modifications to the key processing/detached payload pathways.
2026-05-21
Initial vulnerability fix is developed and committed to the PyJWT repository.
2026-09-09
Defense-in-depth patch is committed to ensure from_jwk handles empty parameters securely.
2026-09-11
PyJWT version 2.14.0 is tagged and released, containing full resolutions for CVE-2026-102266.
2026-09-11
CVE-2026-102266 is officially published to the National Vulnerability Database.
2026-09-28

References & Sources

  • [1]NVD Reference
  • [2]CVE Record
  • [3]GitHub Advisory Database
  • [4]Official Release Notes

More Reports

•about 3 hours ago•CVE-2026-9639
6.5

CVE-2026-9639: Authenticated Denial of Service via Nil-Pointer Dereference in Canonical LXD Custom Volume Backup Import

CVE-2026-9639 (GHSA-j93m-3j9p-m5m8) is a null pointer dereference vulnerability in Canonical LXD affecting versions 5.0.0 through 5.21.4 and 6.0 through 6.8. The flaw resides in the (*lxdBackend).CreateCustomVolumeFromBackup method within lxd/storage/backend_lxd.go. An authenticated attacker with the can_create_storage_volumes permission can upload a crafted custom volume backup tarball that omits the expires_at field on a snapshot entry, triggering an unhandled SIGSEGV panic and terminating the LXD daemon.

Amit Schendel
Amit Schendel
5 views•9 min read
•about 4 hours ago•CVE-2026-33050
8.8

CVE-2026-33050: OS Command Injection in GeoNode Vector Upload Handler

An operating system command injection vulnerability (CWE-78) exists in GeoNode versions prior to 5.1.0. The vulnerability occurs in the vector upload processing pipeline when handling user-supplied geospatial files. By supplying a crafted layer name containing shell metacharacters, an authenticated attacker with basic data upload privileges can execute arbitrary commands on the underlying server or container hosting the GeoNode application and Celery worker processes.

Alon Barad
Alon Barad
5 views•9 min read
•about 5 hours ago•CVE-2026-46429
5.5

CVE-2026-46429: Unrestricted File Upload and Validation Bypass in GeoNode

GeoNode versions prior to 5.0.3 contain an unrestricted file upload vulnerability (CWE-434) within the document and dataset ingestion architecture. Authenticated low-privileged users can bypass upload validation via direct REST API interactions, file extension masquerading, metadata mutation via PATCH requests, or malicious archive submissions. This allows attackers to store and serve dangerous file types, alter on-disk file references, or trigger path traversal and resource exhaustion during archive extraction.

Amit Schendel
Amit Schendel
6 views•10 min read
•about 6 hours ago•CVE-2026-55649
6.3

CVE-2026-55649: Stored Cross-Site Scripting in GeoNode Document Metadata Abstract Field

CVE-2026-55649 is a stored Cross-Site Scripting (XSS) vulnerability in GeoNode versions prior to 5.0.3. The flaw exists because document abstract metadata fields are ingested via the metadata management pipeline and stored in the backend database without HTML sanitization or input neutralization. An authenticated attacker with privileges to create or edit document metadata can inject arbitrary HTML and JavaScript payloads into these fields. When another user, such as an administrator, views the affected document page or catalog listing, the unencoded payload is rendered into the Document Object Model (DOM) and executes within the victim's browser session.

Amit Schendel
Amit Schendel
7 views•9 min read
•about 7 hours ago•GHSA-QX75-2P3R-PWM5
7.7

CVE-2026-55622: Cross-Project Instance Copy Authorization Bypass in Canonical LXD and LXC Incus

CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.

Amit Schendel
Amit Schendel
6 views•11 min read
•about 8 hours ago•GHSA-7MR3-28H5-M5VX
7.7

GHSA-7mr3-28h5-m5vx: Authorization Bypass and Cross-Project Volume Copy in Canonical LXD

An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.

Alon Barad
Alon Barad
5 views•10 min read