CVE-2026-55244 Overview
CVE-2026-55244 is a denial-of-service vulnerability in ASTEVAL, a Python library that evaluates user-supplied expressions and statements inside a sandboxed Interpreter. Versions prior to 1.0.9 expose BaseException, SystemExit, KeyboardInterrupt, and GeneratorExit to evaluated expressions through the FROM_PY symbol table in asteval/astutils.py. The interpreter's run() and eval() methods catch only Exception, so these non-ExceptionBaseException subclasses bypass the safety handlers and propagate into the calling application. An attacker who controls an evaluated expression can terminate the host process or disrupt signal and cleanup handling. The issue is classified under [CWE-248: Uncaught Exception].
Critical Impact
Attacker-controlled expressions can raise SystemExit or KeyboardInterrupt inside asteval.Interpreter.eval() and terminate the consuming service, producing a denial of service.
Affected Products
- ASTEVAL versions prior to 1.0.9
- Applications embedding asteval.Interpreter to evaluate untrusted expressions
- Python services exposing ASTEVAL-backed calculators, formula fields, or scripting endpoints
Discovery Timeline
- 2026-09-14 - CVE-2026-55244 published to the National Vulnerability Database (NVD)
- 2026-09-16 - Last updated in NVD database
- Version 1.0.9 - Fix released via GitHub Release 1.0.9 and GitHub Security Advisory GHSA-89v8-rhwq-hf77
Technical Details for CVE-2026-55244
Vulnerability Analysis
ASTEVAL builds a whitelist of Python built-ins named FROM_PY in asteval/astutils.py and exposes them to expressions evaluated by Interpreter.eval(). Prior to 1.0.9, this whitelist included BaseException, SystemExit, KeyboardInterrupt, and GeneratorExit. These four classes derive from BaseException rather than Exception, which changes how Python's exception machinery handles them.
When an evaluated expression raises one of these classes, on_raise() forwards the class to raise_exception(). The wrapping try blocks in run() and eval() catch only Exception, so the raised BaseException subclass is not intercepted by ASTEVAL's safety handlers. The exception continues up the Python call stack into the embedding application, where it can trigger interpreter shutdown or disrupt signal handling.
Root Cause
The root cause is an unsafe intersection of two design choices: exposing BaseException subclasses to sandboxed code, and using except Exception in the sandbox's outer handler. Because SystemExit and KeyboardInterrupt intentionally bypass generic Exception handlers so that shutdown signals can propagate, granting evaluated expressions the ability to raise them defeats the sandbox boundary. The separately documented read-only open() capability is not part of this vulnerability.
Attack Vector
Exploitation requires an application that passes attacker-influenced input to asteval.Interpreter.eval(). The attacker submits a short expression such as raise SystemExit or raise KeyboardInterrupt. Instead of returning a sandboxed error, the exception unwinds the calling thread, and long-running services embedding ASTEVAL can crash or lose in-flight state.
The upstream patch removes BaseException, SystemExit, GeneratorExit, and related classes from FROM_PY, and adds an explicit except BaseException branch that converts unexpected BaseException subclasses into a controlled RuntimeError.
# asteval/astutils.py - FROM_PY whitelist trimmed to remove BaseException subclasses
FROM_PY = ('ArithmeticError', 'AssertionError', 'AttributeError',
'BaseException', 'BufferError', 'BytesWarning',
'DeprecationWarning', 'EOFError', 'EnvironmentError',
- 'Exception', 'False', 'FloatingPointError', 'GeneratorExit',
+ 'Exception', 'False', 'FloatingPointError',
'IOError', 'ImportError', 'ImportWarning', 'IndentationError',
'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError',
'MemoryError', 'NameError', 'None',
'NotImplementedError', 'OSError', 'OverflowError',
'ReferenceError', 'RuntimeError', 'RuntimeWarning',
'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError',
- 'SystemExit', 'True', 'TypeError', 'UnboundLocalError',
+ 'True', 'TypeError', 'UnboundLocalError',
'UnicodeDecodeError', 'UnicodeEncodeError', 'UnicodeError',
'UnicodeTranslateError', 'UnicodeWarning', 'ValueError',
'Warning', 'ZeroDivisionError', 'abs', 'all', 'any', 'bin',
# asteval/asteval.py - explicit BaseException handler added
self.raise_exception(None, exc=SyntaxError, expr=text)
except Exception:
self.raise_exception(None, exc=RuntimeError, expr=text)
+ except BaseException as exc:
+ self.raise_exception(node, exc=RuntimeError,
+ msg=f"asteval will not raise {exc.__name__}")
+
out = ast.fix_missing_locations(out)
return out
Source: GitHub Commit 9c625b3 and GitHub Commit c49c99a.
Detection Methods for CVE-2026-55244
Indicators of Compromise
- Unexpected process exits or worker restarts in services that evaluate user-submitted formulas or expressions with ASTEVAL.
- Application logs showing untrapped SystemExit, KeyboardInterrupt, or GeneratorExit traces originating in asteval/asteval.py.
- User-submitted expressions containing tokens such as raise SystemExit, raise KeyboardInterrupt, or raise BaseException.
Detection Strategies
- Perform software composition analysis (SCA) across Python environments to enumerate installed asteval versions and flag any release earlier than 1.0.9.
- Add server-side input inspection on endpoints that forward strings to Interpreter.eval() to detect raise statements referencing BaseException subclasses.
- Correlate abnormal service termination events with the request identifiers that immediately preceded them to isolate crafted expressions.
Monitoring Recommendations
- Emit structured logs from every ASTEVAL evaluation call, including the expression length, source identity, and any exception class name propagated out of the sandbox.
- Alert when Python worker processes exit with SystemExit codes outside of planned shutdown windows.
- Track dependency drift for asteval in continuous integration to ensure fixed versions remain pinned after upgrade.
How to Mitigate CVE-2026-55244
Immediate Actions Required
- Upgrade asteval to version 1.0.9 or later in all Python environments that expose the Interpreter to untrusted input.
- Audit application code paths that call asteval.Interpreter.eval() or run() and confirm they wrap calls in handlers that catch BaseException defensively.
- Rotate or restart long-running services after upgrade to clear any resident vulnerable interpreter instances.
Patch Information
The maintainers fixed the issue in ASTEVAL 1.0.9. The patch removes BaseException, SystemExit, and GeneratorExit from the FROM_PY whitelist and adds an explicit except BaseException branch in the interpreter that converts unexpected exceptions into a controlled RuntimeError. See GitHub Pull Request #153 and GitHub Security Advisory GHSA-89v8-rhwq-hf77 for the full change set.
Workarounds
- If immediate upgrade is not possible, wrap ASTEVAL calls in a try / except BaseException block that logs and converts the exception into an application-level error.
- Restrict which users or services can submit expressions to ASTEVAL, and validate expression strings against an allowlist of tokens before evaluation.
- Run ASTEVAL-backed evaluation in short-lived worker processes so that a raised SystemExit cannot destabilize the primary service.
# Upgrade asteval to the fixed release
pip install --upgrade 'asteval>=1.0.9'
# Verify the installed version
python -c "import asteval; print(asteval.__version__)"
# Enumerate vulnerable installations across a fleet
pip list --format=freeze | grep -i '^asteval=='
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

