CVE-2026-85394
Improper key validation lets attackers forge HS256 tokens using public DER keys.
- CVSS 9.3
- 347
- Cryptographic
- Remote
python-jose through 3.5.0 fails to properly validate asymmetric keys in HMAC initialization, accepting DER-encoded public keys that lack PEM armor or SSH prefixes. Attackers holding the service's public key can forge HS256 tokens that pass verification when algorithms are not explicitly restricted. This is an incomplete fix for CVE-2024-33663.
- CWE
- 347
- CVSS base score
- 9.3
- Published
- 2026-09-03
- OWASP
- A02 Cryptographic Failures
- Orthogonal defect classification
- Checking
- Code defect classification
- Incorrect Check
- Category
- Cryptographic
- Subcategory
- Cryptographic Implementation Error
- Accessibility scope
- Remote
- Impact
- Unauthorized Access
- Affected component
- python-jose
- Fixed by upgrading
- Yes
Solution
Upgrade python‑jose to version 3.5.1 or newer.
Vulnerable code sample
from jose import jwt
def verify_token(token: str, key: bytes) -> dict:
# VULNERABLE: accepts DER‑encoded public key as HMAC secret
return jwt.decode(token, key)Patched code sample
from jose import jwt
def verify_token(token: str, key: bytes) -> dict:
# FIX: restrict algorithms to prevent asymmetric key misuse
return jwt.decode(token, key, algorithms=["HS256"])Payload
__VAITP_MODEL_REFUSED__
Cite this entry
@misc{vaitp:cve202685394,
title = {{Improper key validation lets attackers forge HS256 tokens using public DER keys.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-85394},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-85394/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
