CVE-2026-102275: PyJWT OKP Key Identity Confusion Vulnerability
Summary
CVE-2026-102275: PyJWT accepts inconsistent OKP x/d JWKs, causing public/private key identity confusion. Affects pyjwt versions >= 2.1.0, < 2.15.0. Fixed in 2.15.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
PyJWT is a Python library that allows developers to encode and decode JSON Web Tokens (JWTs). It supports various algorithms for signing and verifying tokens, making it a popular choice for authentication in web applications. However, a vulnerability has been identified in its handling of OKP (Octet Key Pair) private JWKs, which can lead to security issues if not addressed.
Vulnerability Detail
The vulnerability arises from PyJWT's acceptance of inconsistent OKP private JWKs, where the declared public key 'x' does not correspond to the supplied private key 'd'. This inconsistency allows an attacker to create a JWK that appears valid but uses a different private key for cryptographic operations. As a result, an attacker can exploit this flaw in DPoP (Demonstrating Proof of Possession) integrations, potentially allowing them to use stolen access tokens without possessing the legitimate holder's private key. The issue has existed since the introduction of OKP private-JWK import in PyJWT versions 2.1.0 and 2.2.0, and it has been confirmed in versions up to 2.14.0.
How To Fix
Latest published version: 2.15.1 as of 23 Oct 2026
pip install --upgrade "pyjwt==2.15.1"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
2.15.0
This is the first release that contains the fix.
pip install --upgrade "pyjwt==2.15.0"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, ensure that your DPoP implementation rejects any JWKs that contain private key parameters (such as 'd'). This can be done by validating the JWK before passing it to PyJWT for signature verification.
Conclusion
The vulnerability identified as CVE-2026-102275 in PyJWT poses a significant risk due to the acceptance of inconsistent OKP keys. It is crucial for developers using this library to update to version 2.15.0 or later to mitigate this risk. Additionally, implementing workarounds to reject private key parameters can provide an extra layer of security.
See every vulnerability recorded for pyjwt →
FAQ
The vulnerability allows for the acceptance of inconsistent public and private keys in OKP JWKs, leading to potential security breaches.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
An attacker could use a stolen access token without having the legitimate holder's private key, compromising the security of the application.
Yes, the vulnerability has been fixed in PyJWT version 2.15.0. Updating to this version will resolve the issue.
The CVSS score for this vulnerability is 6.5, indicating a moderate level of severity.
References
Related vulnerabilities
Recent vulnerabilities recorded for pyjwt.