CVE-2026-55244
BaseException subclasses can escape Asteval, causing DoS via untrusted expressions.
- CVSS 5.0
- 248
- Design Defects
- Remote
ASTEVAL is an evaluator of Python expressions and statements. Prior to 1.0.9, FROM_PY in asteval/astutils.py exposes BaseException, SystemExit, KeyboardInterrupt, and GeneratorExit to expressions evaluated by asteval.Interpreter.eval(), while run() and eval() in asteval/asteval.py catch Exception rather than these non-Exception BaseException subclasses. When an attacker-controlled expression raises one of these classes, on_raise() passes the class to raise_exception(), and the resulting exception bypasses the interpreter's safety handlers and propagates into the calling application. A consuming service that evaluates untrusted expressions can therefore be terminated or have signal and cleanup handling disrupted, causing denial of service. The separately documented read-only open() capability is not part of this vulnerability. This issue is fixed in version 1.0.9.
- CWE
- 248
- CVSS base score
- 5.0
- Published
- 2026-09-14
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Design Defects
- Subcategory
- Inadequate Error Handling
- Accessibility scope
- Remote
- Impact
- Denial of Service (DoS)
- Affected component
- asteval
- Fixed by upgrading
- Yes
Solution
Upgrade asteval to version 1.0.9 or later.
Vulnerable code sample
from asteval import Interpreter
def evaluate_expression(expr):
"""Evaluate an untrusted Python expression using asteval."""
# VULNERABLE: BaseException subclasses are exposed and can escape safety handlers
interp = Interpreter()
return interp.eval(expr)Patched code sample
from asteval import Interpreter
def evaluate_expression(expr):
"""Evaluate an untrusted Python expression using a hardened asteval interpreter."""
# FIX: remove BaseException subclasses from the interpreter's symbol table
interp = Interpreter()
for name in list(interp.symtable):
if isinstance(interp.symtable[name], BaseException):
del interp.symtable[name]
return interp.eval(expr)Payload
__VAITP_MODEL_REFUSED__
Cite this entry
@misc{vaitp:cve202655244,
title = {{BaseException subclasses can escape Asteval, causing DoS via untrusted expressions.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-55244},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-55244/}}
}
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 ::
