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

CVE-2026-102275: Public/Private Key Identity Confusion in PyJWT OKP JWK Processing

Amit Schendel
Amit Schendel
Senior Security Researcher

Oct 6, 2026·6 min read·3 visits

Executive Summary (TL;DR)

PyJWT fails to verify that the public and private parameters of an imported OKP (Ed25519/Ed448) JWK belong to the same key pair. This allows attackers to forge a hybrid key containing a victim's public key and their own private key, bypassing cryptographic token bindings such as DPoP.

CVE-2026-102275 (GHSA-x33g-cr3x-6449) is a public/private key identity confusion vulnerability in PyJWT versions 2.1.0 through 2.14.0. When importing Octet Key Pair (OKP) JSON Web Keys (JWKs) representing Ed25519 or Ed448 curves, PyJWT fails to verify that the public parameter 'x' matches the private parameter 'd'. An attacker can construct a hybrid JWK combining a victim's public key with the attacker's private key. In protocols like DPoP that bind sessions via public key thumbprints, this allows the attacker to authenticate as the victim while signing proofs with their own private key, fully bypassing sender-constrained security guarantees.

Vulnerability Overview

The pyjwt library provides cryptographic signing and verification operations for JSON Web Tokens (JWT) and JSON Web Signatures (JWS) in Python environments. To process JSON Web Keys (JWKs), the library implements parsing functions to map JSON data to cryptographic key objects using the Python standard cryptography library. Under RFC 8037, Octet Key Pairs (OKP) are used for Ed25519 and Ed448 signatures, presenting a specific attack surface when untrusted clients present keys directly to the server.

This vulnerability belongs to the cryptographic identity confusion bug class (specifically CWE-345). It affects the deserialization phase of OKP JWK structures. When an application imports a JWK containing both public and private key parameters, pyjwt fails to mathematically validate the relationship between the two parameters. This flaw occurs within the algorithm-specific JWK parser, which assumes the underlying cryptographic engine validates key consistency implicitly.

In identity-bound authentication schemes such as Demonstrating Proof-of-Possession (DPoP, RFC 9449), the authentication framework extracts the client's identity using the JWK's public components. If the application processes client-supplied keys without validation, this implementation flaw allows an unauthorized entity to bypass cryptographic guarantees. An attacker can construct a hybrid key that maps to a legitimate user's identity but is cryptographically controlled by the attacker.

Root Cause Analysis

The root cause of CVE-2026-102275 resides in jwt/algorithms.py inside the OKPAlgorithm.from_jwk deserialization method. RFC 8037 defines OKP JWK payloads using three main parameters: the curve identifier (crv), the public key coordinate (x), and the optional private key scalar (d). Standard security requirements demand that if both x and d are supplied in a single JWK object, they must represent a mathematically coherent public/private key pair.

In affected versions of PyJWT, the algorithm checks for the presence of the private key parameter d. If d is absent, the parser instantiates a public key object strictly using the decoded bytes of x. If d is present, the parser bypasses the x parameter entirely and directly passes the bytes of d to from_private_bytes(). The library instantiates a private key object and immediately returns it to the calling application without verifying the relationship between x and d.

Because the Python cryptography library's from_private_bytes() function does not require or accept the associated public key bytes to initialize an OKP private key, the logic allows a severe discrepancy. The instantiated private key contains its own mathematically derived public key. However, the outer JWK object retains the mismatched public coordinate x specified by the attacker. Applications that rely on the parsed JWK for thumbprint-based identity binding but use the returned key object for signature verification are left vulnerable to identity confusion.

Code-Level Analysis and Patch Review

In vulnerable versions of PyJWT (2.1.0 to 2.14.0), the OKP JWK import routine executes the following path:

# Vulnerable Implementation in jwt/algorithms.py
x = base64url_decode(obj.get("x"))
if not obj.get("d"):
    if curve == "Ed25519":
        return Ed25519PublicKey.from_public_bytes(x)
    return Ed448PublicKey.from_public_bytes(x)
 
d = base64url_decode(obj.get("d"))
if curve == "Ed25519":
    # Vulnerable: Instantiates private key from d without validating x
    return Ed25519PrivateKey.from_private_bytes(d)
return Ed448PrivateKey.from_private_bytes(d)

The security patch applied in commit 3cd9ceec33ced359decbad75b413ad668ae6332c introduces strict cryptographic verification of the key pair before returning the parsed key:

# Patched Implementation in jwt/algorithms.py
            d = base64url_decode(obj.get("d"))
            private_key: Ed25519PrivateKey | Ed448PrivateKey
            if curve == "Ed25519":
                private_key = Ed25519PrivateKey.from_private_bytes(d)
            else:
                private_key = Ed448PrivateKey.from_private_bytes(d)
            
            # Verification Step: Derive the public key from the private key
            # and assert byte-level equality with the declared public parameter 'x'
            if (
                private_key.public_key().public_bytes(
                    encoding=Encoding.Raw, format=PublicFormat.Raw
                )
                != x
            ):
                raise InvalidKeyError("Public key does not match private key")
            return private_key

This fix is highly effective. By extracting the public key bytes directly from the newly initialized private key using private_key.public_key().public_bytes(...) and running a constant-time comparison against the user-supplied x, the parser guarantees that any discrepancy immediately raises an InvalidKeyError. This blocks hybrid key configurations before they can reach signature verification engines.

Exploitation Methodology in DPoP Scenarios

The primary threat vector for CVE-2026-102275 involves OAuth 2.0 frameworks implementing Demonstrating Proof-of-Possession (DPoP) under RFC 9449. DPoP prevents token theft by binding the access token to the client's private key. The client includes a DPoP HTTP header containing a JWS. The JWS header contains a jwk element representing the client's public key, and the server validates the signature against this public key.

An attacker who intercepts a valid access token bound to a victim's public key x_victim cannot normally use it because they lack the corresponding private key. To exploit this vulnerability, the attacker generates their own key pair (x_attacker, d_attacker) and crafts a malicious hybrid JWK. The attacker sets the public parameter `

Impact Assessment & Threat Context

The concrete security impact of CVE-2026-102275 is an authentication and sender-constraint bypass on services implementing Ed25519/Ed448 tokens. An attacker can hijack existing sessions, impersonate legitimate clients, and perform unauthorized API operations. The attack requires no prior privileges or user interaction, assuming the attacker has obtained a target token and has network access to the target API.

The CVSS v3.1 score is evaluated at 6.5 (Medium) with the vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N. The High Attack Complexity reflects the fact that an exploit requires the target system to accept private key parameters within client-supplied headers. Although standard implementations of DPoP explicitly reject private parameters, many API gateways and custom resource servers do not perform this check, parsing the JWK structurally without filtering.

EPSS scores show a low probability of exploitation in the wild (0.00137), primarily because the vulnerability relies on the intersection of OKP algorithms and loose input validation policies. However, inside enterprise architectures that rely heavily on decentralized JWT validation and trust-on-first-use models, this flaw constitutes a silent, critical security bypass.

Mitigation and Defensive Implementation

The definitive remediation is upgrading the PyJWT installation to version 2.15.0 or later, which enforces key consistency out-of-the-box. If upgrading PyJWT is not immediately feasible due to legacy dependency constraints, applications must implement input-filtering middleware to inspect incoming JWK structures.

According to RFC 9449, clients must never transmit private key parameters within public headers. Implementing an explicit schema-validation layer that inspects client-provided JWKs for the presence of the private key parameter d mitigates this attack vector at the application boundary. If d is detected in a client-supplied token or header, the transaction must be blocked immediately.

# Defensive Validation Middleware
def enforce_public_jwk_only(jwk_payload: dict) -> None:
    forbidden_private_keys = {"d", "p", "q", "dp", "dq", "qi"}
    if any(param in jwk_payload for param in forbidden_private_keys):
        raise ValueError("Security Exception: Private key components detected in client-supplied JWK.")

Additionally, applications should restrict the supported signature algorithms (algorithms parameter in jwt.decode()) to the absolute minimum. If your environment does not strictly require Ed25519 or Ed448, omitting 'EdDSA' from the allowed algorithms list fully neutralizes the attack surface.

Official Patches

jpadillaFix commit implementing public key comparison during OKP JWK load

Fix Analysis (1)

Technical Appendix

CVSS Score
6.5/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N
EPSS Probability
0.14%
Top 97% most exploited

Affected Systems

PyJWT

Affected Versions Detail

Product
Affected Versions
Fixed Version
pyjwt
jpadilla
>= 2.1.0, < 2.15.02.15.0
AttributeDetail
Vulnerability IDCVE-2026-102275
CWE IDCWE-345 (Insufficient Verification of Data Authenticity)
Attack VectorNetwork (Unauthenticated)
CVSS v3.1 Score6.5 (Medium)
Exploit StatusProof of Concept (PoC) available
CISA KEV StatusNot Listed
Primary ImpactAuthentication Bypass / Security Token Hijacking

MITRE ATT&CK Mapping

T1556Modify Authentication Process
Credential Access
T1606.001Use Alternate Authentication Material: Web Cookies/Tokens
Defense Evasion
CWE-345
Insufficient Verification of Data Authenticity

The software does not sufficiently verify the authenticity of data, allowing an attacker to supply modified or forged keys that pass validation under specific circumstances.

Known Exploits & Detection

GitHub Security AdvisoryAdvisory text containing detailed information about the vulnerability mechanics and fix.

Vulnerability Timeline

OKP (Ed25519/Ed448) JWK import support introduced in PyJWT version 2.1.0.
2021-05-01
Security patch authored by José Padilla to address inconsistent OKP private keys (Commit 3cd9ceec).
2026-09-12
GitHub Security Advisory GHSA-x33g-cr3x-6449 and CVE-2026-102275 published.
2026-09-28
PyJWT version 2.15.0 officially released containing the security fix.
2026-09-28

References & Sources

  • [1]GitHub Security Advisory GHSA-x33g-cr3x-6449
  • [2]Fix Commit in GitHub Repository
  • [3]PyJWT Release 2.15.0
  • [4]NVD - CVE-2026-102275
  • [5]CVE Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 2 hours ago•CVE-2026-104181
5.4

CVE-2026-104181: Authentication Bypass and Privilege Escalation in Filament Multi-Factor Authentication

An authentication bypass and privilege escalation vulnerability exists in Filament (filamentphp/filament) due to missing password verification during multi-factor authentication (MFA) setup and management. An attacker with access to an active session can modify or disable MFA, leading to account hijacking.

Amit Schendel
Amit Schendel
4 views•6 min read
•about 3 hours ago•CVE-2026-102600
7.5

CVE-2026-102600: Unhandled Runtime Exception via Unsafe Prototype Lookup in @socket.io/cluster-engine

A critical Denial of Service (DoS) vulnerability exists in @socket.io/cluster-engine before version 0.1.1. Unauthenticated remote attackers can crash the server process by supplying inherited prototype property names as session identifiers.

Alon Barad
Alon Barad
7 views•6 min read
•about 4 hours ago•CVE-2026-96747
5.0

CVE-2026-96747: Local Unix Domain Socket SSRF via KMS Endpoint Manipulation in PyMongo

A vulnerability in the Client-Side Field-Level Encryption (CSFLE) component of the MongoDB Python Driver (PyMongo) allows an attacker with database write access to trigger local Unix domain socket connections. By manipulating the Key Management Service (KMS) endpoint configuration inside the key vault collection to end with a '.sock' extension, an attacker forces the application to perform a Server-Side Request Forgery (SSRF) against internal Unix domain sockets.

Alon Barad
Alon Barad
7 views•6 min read
•about 5 hours ago•CVE-2026-52993
9.8

CVE-2026-52993: Double-Free Vulnerability in Linux Kernel TIPC Module

A critical double-free vulnerability exists in the Transparent Inter-Process Communication (TIPC) module of the Linux kernel, specifically within the fragment reassembly implementation in `tipc_buf_append()`. This vulnerability can be triggered locally or remotely to cause kernel heap corruption, leading to local privilege escalation or denial of service.

Amit Schendel
Amit Schendel
7 views•7 min read
•about 5 hours ago•CVE-2026-72137
9.8

CVE-2026-72137: Double Free in Linux Kernel XFRM NAT Keepalive

CVE-2026-72137 is a critical double-free vulnerability in the Linux kernel's XFRM (IPsec) subsystem. The vulnerability occurs when the kernel attempts to send NAT keepalive packets over UDP. Under specific transmission failure conditions, both the downstream networking stack and the upstream keepalive dispatcher attempt to free the same socket buffer (sk_buff) structure, leading to kernel memory corruption, denial of service, or potential local privilege escalation.

Amit Schendel
Amit Schendel
7 views•7 min read
•about 5 hours ago•CVE-2026-96748
8.3

CVE-2026-96748: Host Injection Vulnerability in PyMongo Connection String Parsing

A critical host injection vulnerability exists in PyMongo's connection string parser prior to version 4.18.2. The parser globally decodes percent-encoded characters in the host portion before splitting on delimiters, allowing attackers to inject arbitrary servers into the database client's connection pool.

Amit Schendel
Amit Schendel
7 views•7 min read