From 2.4.0 until 2.14.0, PyJWT HMACAlgorithm.prepare_key is affected because asymmetric-key guard relies on textual
Affects pyjwtSource GCVE Database
Not known to be exploited · CVSS 7.4 High · fixed in 1.3.0-1ubuntu0.1+esm3 : patch pyjwt soon.
Data as of 27 Oct 2026, 14:30 UTC
- Patch
- Available – fixed in 1.3.0-1ubuntu0.1+esm3, 1.5.3+ds1-1ubuntu0.1+esm3, 1.7.1-2ubuntu2.1+esm3 +4
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:NExploitation evidence
Disclosed: evidence found.
CVE published 28 Sep 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade to a fixed release listed under Affected software.
Patches and advisories
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Ubuntu 26.10pyjwtpkg:deb/ubuntu/pyjwt?arch=source&distro=stonkingOther threats | Affected
| Fixed in
|
Ubuntu 26.04 LTSpyjwtpkg:deb/ubuntu/pyjwt?arch=source&distro=resoluteOther threats | Affected
| Fixed in
|
Ubuntu 24.04 LTSpyjwtpkg:deb/ubuntu/pyjwt?arch=source&distro=nobleOther threats | Affected
| Fixed in
|
Ubuntu 22.04 LTSpyjwtpkg:deb/ubuntu/pyjwt?arch=source&distro=jammyOther threats | Affected
| Fixed in
|
Ubuntu Pro 20.04 LTSpyjwtpkg:deb/ubuntu/pyjwt?arch=source&distro=esm-infra/focalOther threats | Affected
| Fixed in
|
Ubuntu Pro 18.04 LTSpyjwtpkg:deb/ubuntu/pyjwt?arch=source&distro=esm-infra/bionicOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A fix is available and users should update PyJWT to version 2.14.0 or later. Ubuntu users should apply the security updates provided in the following package versions: 1.3.0-1ubuntu0.1+esm3, 1.5.3+ds1-1ubuntu0.1+esm3, 1.7.1-2ubuntu2.1+esm3, 2.3.0-1ubuntu0.5, 2.7.0-1ubuntu0.3, 2.10.1-4ubuntu1.2, or 2.13.0-1ubuntu1. Standard system updates will apply these fixes. No additional mitigation is required beyond applying these patches.
Description
PyJWT versions from 2.4.0 up to 2.14.0 contain a vulnerability in the HMACAlgorithm.prepare_key function. The issue arises because the asymmetric-key guard relies on textual markers that are missing from DER-encoded public keys. When an application mixes HMAC and asymmetric algorithms and uses a DER public key as the shared verification key, PyJWT mistakenly uses the public DER bytes as an HMAC secret. This flaw allows an attacker who knows the public key to forge authenticated HMAC tokens. The vulnerability is fixed in version 2.14.0.
References
- ubuntu.com/security/CVE-2026-102271 (opens in a new tab)
- cve.org/CVERecord?id=CVE-2026-102271 (opens in a new tab)
- github.com/jpadilla/pyjwt/security/advisories/GHSA-p4g4-x82p-q773 (opens in a new tab)
- github.com/jpadilla/pyjwt/commit/2798504fa2663364573cf2d1043d8d7fef389499 (opens in a new tab)
- github.com/jpadilla/pyjwt/releases/tag/2.14.0 (opens in a new tab)
- ubuntu.com/security/notices/USN-8916-2 (opens in a new tab)
- ubuntu.com/security/notices/USN-8916-1 (opens in a new tab)