CVE-2026-102271
published 2026-09-28CVE-2026-102271: PyJWT is a Python implementation of JSON Web Token standards. From 2.4.0 until 2.14.0, PyJWT HMACAlgorithm.prepare_key is affected because asymmetric-key guard…
PriorityP343high7.4CVSS 3.1
AVNACHPRNUINSUCHIHAN
EPSS
0.18%
7.1th percentile
PyJWT is a Python implementation of JSON Web Token standards. From 2.4.0 until 2.14.0, PyJWT HMACAlgorithm.prepare_key is affected because asymmetric-key guard relies on textual markers that are absent from DER encoding. This occurs when an application mixes HMAC and asymmetric algorithms and supplies a DER public key as the shared verification key. As a result, PyJWT uses public DER bytes as an HMAC secret. Consequently, an attacker who knows the public key can forge authenticated HMAC tokens. This issue is fixed in version 2.14.0.
Affected
3 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| pyjwt_project | pyjwt | >= 2.4.0 < 2.14.0 | 2.14.0 |
| pyjwt_project | pyjwt | >= 2.4.0 < 2.14.0 | 2.14.0 |
| ubuntu | pyjwt | — | — |
CVSS provenance
nvdv3.17.4HIGHCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
ghsa7.5HIGH
vendor_ubuntu9.1CRITICAL
vendor_redhat7.4HIGH
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
GHSA
PyJWT: Public keys in DER form are accepted as HMAC secrets, bypassing the CVE-2022-29217 guard
ghsa·2026-09-29·CVSS 7.5
CVE-2026-102271 [HIGH] CWE-347 PyJWT: Public keys in DER form are accepted as HMAC secrets, bypassing the CVE-2022-29217 guard
PyJWT: Public keys in DER form are accepted as HMAC secrets, bypassing the CVE-2022-29217 guard
### Summary
`HMACAlgorithm.prepare_key` 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 misconf
VulDB
jpadilla PyJWT up to 2.13.x HMACAlgorithm HMACAlgorithm.prepare_key signature verification
vuldb·2026-09-28·CVSS 7.4
CVE-2026-102271 [HIGH] jpadilla PyJWT up to 2.13.x HMACAlgorithm HMACAlgorithm.prepare_key signature verification
A vulnerability was found in jpadilla PyJWT up to 2.13.x. It has been rated as critical. The impacted element is the function HMACAlgorithm.prepare_key of the component HMACAlgorithm. This manipulation causes improper verification of cryptographic signature.
This vulnerability is tracked as CVE-2026-102271. The attack is possible to be carried out remotely. No exploit exists.
Upgrading the affected component is advised.
Ubuntu
PyJWT vulnerabilities
vendor_ubuntu·2026-10-13·CVSS 9.1
CVE-2026-102267 [CRITICAL] PyJWT vulnerabilities
Title: PyJWT vulnerabilities
Summary: Several security issues were fixed in PyJWT.
YuSung Han discovered that PyJWT did not properly validate certain JWK keys
when performing HMAC verification. An attacker could possibly use this
issue to forge authentication tokens. This issue only affected Ubuntu
26.04 LTS. (CVE-2026-102266)
Rohan Das discovered that PyJWT incorrectly handled redirects when fetching
key sets. A remote attacker could possibly use this issue to cause PyJWT
to disclose sensitive information. This issue only affected Ubuntu 22.04
LTS, Ubuntu 24.04 LTS, Ubuntu 26.04 LTS. (CVE-2026-102267)
It was discovered that PyJWT incorrectly recognized certain PEM
representations. An attacker who knew the public key could possibly use
this issue to forge authentication tokens. This is
Red Hat
pyjwt: PyJWT: Authentication bypass via acceptance of DER public keys as HMAC secrets
vendor_redhat·2026-09-28·CVSS 7.4
CVE-2026-102271 [HIGH] CWE-347 pyjwt: PyJWT: Authentication bypass via acceptance of DER public keys as HMAC secrets
pyjwt: PyJWT: Authentication bypass via acceptance of DER public keys as HMAC secrets
PyJWT is a Python implementation of JSON Web Token standards. From 2.4.0 until 2.14.0, PyJWT HMACAlgorithm.prepare_key is affected because asymmetric-key guard relies on textual markers that are absent from DER encoding. This occurs when an application mixes HMAC and asymmetric algorithms and supplies a DER public key as the shared verification key. As a result, PyJWT uses public DER bytes as an HMAC secret. Consequently, an attacker who knows the public key can forge authenticated HMAC tokens. This issue is fixed in version 2.14.0.
A flaw was found in PyJWT. The library fails to identify asymmetric public keys supplied in Distinguished Encoding Rules (DER) format, inadvertently treating the public data
No detection rules found.
No public exploits indexed.
2026-09-28
Published