CVE-2026-103001
Mutable options map can retain false verification flags, allowing invalid claims.
- CVSS 6.5
- CWE-471
- Design Defects
- Remote
PyJWT is a Python implementation of JSON Web Token standards. From 2.11.0 through 2.13.0, PyJWT's PyJWT._merge_options() method can modify a caller-supplied mutable options mapping when verify_signature is false. If an application reuses that same mapping for a later decode() or decode_complete() call and changes verify_signature to true, the mapping can retain false values for expiration, not-before, issued-at, audience, issuer, subject, and JWT ID checks. A signed token with invalid registered claims can then be accepted without disabling signature verification, but applications that create a fresh options mapping for each call are not affected.
- CWE
- CWE-471
- CVSS base score
- 6.5
- Published
- 2026-09-30
- OWASP
- A02 Cryptographic Failures
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Design Defects
- Subcategory
- Poorly Designed Access Controls
- Accessibility scope
- Remote
- Impact
- Unauthorized Access
- Affected component
- PyJWT
- Fixed by upgrading
- Yes
Solution
Upgrade PyJWT to version 2.13.1 or later.
Vulnerable code sample
import jwt
def verify_token(token, key):
# shared mutable options dict
opts = {
"verify_signature": False, # VULNERABLE: mutable options reused after changing verify_signature
"verify_exp": True,
"verify_nbf": True,
"verify_iat": True,
"verify_aud": True,
"verify_iss": True,
"verify_sub": True,
"verify_jti": True,
}
# first decode without signature verification
jwt.decode(token, key=None, algorithms=["HS256"], options=opts)
# later we enable signature verification but reuse the same dict
opts["verify_signature"] = True
# other verify_* fields remain whatever they were after the first call
jwt.decode(token, key=key, algorithms=["HS256"], options=opts)Patched code sample
import jwt
def verify_token(token, key):
# shared mutable options dict
opts = {
"verify_signature": False, # FIX: pass a copy to avoid mutating shared options
"verify_exp": True,
"verify_nbf": True,
"verify_iat": True,
"verify_aud": True,
"verify_iss": True,
"verify_sub": True,
"verify_jti": True,
}
# first decode without signature verification
jwt.decode(token, key=None, algorithms=["HS256"], options=opts.copy())
# later we enable signature verification but pass a fresh copy
opts["verify_signature"] = True
jwt.decode(token, key=key, algorithms=["HS256"], options=opts.copy())Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- Merge commit from fork (jpadilla/pyjwt)
jwt/api_jwt.py · PyJWT._merge_options
Cite this entry
@misc{vaitp:cve2026103001,
title = {{Mutable options map can retain false verification flags, allowing invalid claims.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-103001},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-103001/}}
}
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 ::
