CVE Feed
7.4 High

PyJWT is a Python implementation of JSON Web Token standards.

CVE-2026-102271

Summary HMACAlgorithm.preparekey blocks asymmetric keys from being used as HMAC secrets by searching for text markers only. It looks for -----BEGIN and for an ssh- prefix. The same key in DER form is binary ASN.1 and has neither marker, so it passes the check and is used as an HMAC secret. An application that verifies tokens with an RSA or EC public key, and also allows HS256 with that same key, can be given a forged token. The attacker signs it with the public key, which is public. This is the key confusion problem CVE-2022-29217 was filed for, reachable again through a different encoding. The reach is smaller than the original CVE. The application must already be in that misconfiguration, and it must hold its public key as DER bytes rather than PEM. Details The guard is at jwt/algorithms.py:331: python if ispemformat(keybytes) or issshkey(keybytes): raise InvalidKeyError( "The specified key is an asymmetric key or x509 certificate and" " should not be used as an HMAC secret." ) Both helpers are text matchers. Neither one parses the key. jwt/utils.py:126, ispemformat, runs a regex for ----[- ]BEGIN ...----. jwt/utils.py:141, issshkey, checks startswith against a list of ssh- and…

Assessment

CVSS
7.4 (v3.1)
Severity
High
EPSS
0.22% chance of exploitation in the next 30 days
Known exploited
Not listed in CISA KEV
Exploit availability
Nothing found in Exploit-DB, Metasploit, Nuclei or public PoC repositories
Published
28 September 2026
Last updated
6 October 2026
Affected
jpadilla · pyjwt · pyjwt
Weakness
CWE-347
Assigner
security-advisories@github.com

CVSS vectorCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

At the source

References

Community proofs of concept

No community proof of concept yet. If you have one for a published vulnerability and the right to share it, add it below — it will appear here once reviewed.

Submit a proof of concept
Before you submit *

Query this programmatically

Agents can read this through the MCP endpoint, or over HTTP:

curl https://cve.zerocrew.in/api/cve/CVE-2026-102271