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
- 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
- https://github.com/jpadilla/pyjwt/commit/2798504fa2663364573cf2d1043d8d7fef389499
- https://github.com/jpadilla/pyjwt/releases/tag/2.14.0
- https://github.com/jpadilla/pyjwt/security/advisories/GHSA-p4g4-x82p-q773
- https://nvd.nist.gov/vuln/detail/CVE-2026-102271
- https://github.com/advisories/GHSA-p4g4-x82p-q773
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
Only for publicly disclosed vulnerabilities, and only material from testing you were authorised to perform. This platform does not buy, sell, or broker exploits — see earning from vulnerability research for legitimate bounty programs. Submissions are reviewed before they appear. Text only; do not include live credentials, personal data, or anything targeting systems you are not permitted to test.
Query this programmatically
Agents can read this through the MCP endpoint, or over HTTP:
curl https://cve.zerocrew.in/api/cve/CVE-2026-102271