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

- Severity: High 7.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 12% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-09-28T20:31:53.066Z
- Modified: 2026-10-06T18:36:16.047Z
- Also known as: GHSA-p4g4-x82p-q773, PYSEC-2026-4149
- Weaknesses: CWE-347
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- jpadilla pyjwt: >= 2.4.0, < 2.14.0
- pyjwt (PyPI): from 2.4.0 before 2.14.0
- pyjwt_project pyjwt: from 2.4.0 before 2.14.0

## Every score

- GitHub_M: CVSS:3.1 7.4 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`
- GitHub: CVSS:3.1 7.4 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`
- PyPA Advisory Database: CVSS:3.1 7.4 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`

## References

- <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-p4g4-x82p-q773> (exploit, patch, vendor-advisory, web)
- <https://github.com/jpadilla/pyjwt/commit/2798504fa2663364573cf2d1043d8d7fef389499> (patch, web)
- <https://github.com/jpadilla/pyjwt/releases/tag/2.14.0> (product, release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-102271> (advisory)
- <https://github.com/jpadilla/pyjwt> (package)
- <https://pypi.org/project/pyjwt> (package)
- <https://github.com/advisories/GHSA-p4g4-x82p-q773> (advisory)

## Sources

- CVE List: [CVE-2026-102271](https://www.cve.org/CVERecord?id=CVE-2026-102271), CVE Terms of Use, modified 2026-10-01
- GitHub Advisory Database: [GHSA-p4g4-x82p-q773](https://github.com/advisories/GHSA-p4g4-x82p-q773), CC-BY-4.0, modified 2026-10-01
- NVD: [CVE-2026-102271](https://nvd.nist.gov/vuln/detail/CVE-2026-102271), Public domain, modified 2026-10-06
- PyPA Advisory Database: [PYSEC-2026-4149](https://osv.dev/vulnerability/PYSEC-2026-4149), CC-BY-4.0, modified 2026-10-01

---

Page: https://cve.day/CVE-2026-102271 · Whole record: https://cve.day/CVE-2026-102271.json · Rebuilt by cve.day 2026-11-25T22:59:41.389Z
