CVE-2026-102272: PyJWT BOM Bypass
PyJWT is a Python implementation of JSON Web Token standards. From 2.13.0 until 2.14.0, HMACAlgorithm.preparekey in jwt/algorithms.py is affected because raw-JWK detector does not normalize accepted Unicode byte-order marks before checking for JSON. This occurs when a public JWK is prefixed with a UTF-8 BOM and used in a mixed-algorithm verification path. As a result, public JWK bypasses asymmetric-key detection and becomes the HMAC secret. Consequently, an attacker who knows the public key can forge authenticated tokens. This issue is fixed in version 2.14.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
PyJWTto a version that resolves this vulnerability.Fixed in 2.14.0
Event History
Frequently Asked Questions
Which PyJWT versions need remediation?
PyJWT versions from 2.13.0 up to, but not including, 2.14.0 are affected. Upgrade to version 2.14.0, which contains the fix.
What conditions are required for exploitation?
The application must use a mixed-algorithm verification path and supply a public JWK prefixed with a UTF-8 byte-order mark. An attacker who knows that public key can then use it as an HMAC secret to forge authenticated tokens.
How can I identify potentially vulnerable key handling?
Review JWT verification code and JWK inputs for mixed asymmetric and HMAC algorithm support. Check whether public JWK material can include a leading UTF-8 BOM before being passed to PyJWT.