CVE-2026-102271 PyJWT: Public keys in DER form are accepted as HMAC secrets, bypassing the CVE-2022-29217 guard

High 7.4 Published Updated

Attackers can forge HMAC tokens by supplying DER public keys as secrets, bypassing algorithm guards in PyJWT applications mixing HMAC and asymmetric algorithms.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-102271?

CVE-2026-102271 is a high-severity vulnerability in jpadilla pyjwt, published on 28 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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.

Weakness: CWE-347

Which versions are affected by CVE-2026-102271?

3 open source packages ship an affected version, including pyjwt. It affects 1 product.

PackageAffectedFixed in
pyjwt PyPIFrom 2.4.02.14.0
pyjwt PyPIFrom 2.4.02.14.0
pyjwt PyPIFrom 2.4.02.14.0

Products include Pyjwt Project Pyjwt.

How do I fix CVE-2026-102271?

Upgrade pyjwt to 2.14.0 or later.

Is CVE-2026-102271 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-102271 exists.

Sources

Also known as AZL-105221, CLEANSTART-2026-PD49878, CLEANSTART-2026-XO84437, DEBIAN-CVE-2026-102271, ECHO-1994-4c86-f69b, GHSA-p4g4-x82p-q773 and 28 more.

Is CVE-2026-102271 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free