Skip to main content

asteval EUVDEUVD-2026-78058

| CVE-2026-55244 MEDIUM
Uncaught Exception (CWE-248)
2026-08-20 https://github.com/lmfit/asteval GHSA-89v8-rhwq-hf77 PYSEC-2026-3807
5.0
CVSS 3.1 · Vendor: https://github.com/lmfit/asteval
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Attacker submits crafted raise expression
  2. Delivery
    asteval.eval() parses and runs AST node
  3. Exploit
    on_raise() calls raise_exception() with SystemExit class
  4. Install
    raise SystemExit(msg) executes inside sandbox
  5. C2
    except Exception: handler in run()/eval() fails to intercept
  6. Execute
    SystemExit propagates to calling application
  7. Impact
    Process terminates

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A10:2025 - Mishandling of Exceptional Conditions
ASVS 5.0
V16 - Security Logging and Error Handling Exception handling completeness
Exploitation Conditions

Exploitation requires the ability to supply arbitrary string expressions to asteval.Interpreter.eval() - the precise condition is attacker-controlled input reaching an eval call in the target application. The application must use standard except Exception: error handling (the universal Python convention), which structurally cannot catch SystemExit, KeyboardInterrupt, or GeneratorExit. No authentication, memory corruption, or race condition is required; the payload is a single-line Python raise statement. Exploitation is bounded strictly to availability: the attacker can terminate the process or disrupt signal and cleanup handlers, but cannot read files (beyond the separate documented open() limitation), write data, or execute arbitrary OS commands. Applications that wrap aeval.eval() in except BaseException: rather than except Exception: are not vulnerable to this specific escape, but that pattern is non-standard and unlikely to be present without deliberate hardening.

Impact

The provided CVSS vector (AV:L/AC:L/PR:L/UI:R, score 5.0) is inconsistent with the advisory's own characterization, which explicitly argues AV:N/AC:L/PR:N/UI:N for network-deployed applications. This conflict is unresolved in the available data and should be verified against the maintainer's advisory. The discrepancy is not trivial: if the application exposes asteval expression evaluation over a network endpoint without authentication, the effective exploitability approaches AV:N/PR:N, yielding a base score of 7.5 - materially higher than the listed 5.0. EPSS data was not provided, preventing quantitative exploitation-probability comparison. The vulnerability is not in CISA KEV, but the proof-of-concept is fully public and requires no exploit sophistication - the payload is a single Python statement. Impact is limited strictly to availability (process termination or signal-handler disruption); there is no confidentiality or integrity impact. The separate open() file-read exposure noted in the advisory is a documented design limitation, not part of this CVE. For any service using asteval to evaluate user-supplied expressions, patch to 1.0.9 is the clear priority; the DoS primitive is reliable and low-skill.

Exploit ScenarioDerived

An attacker with access to submit expressions to an asteval-powered web API sends the payload raise SystemExit(1). The expression is processed by on_raise(), which calls raise_exception() with the SystemExit class; this raises a SystemExit that propagates through both except Exception: handlers uncaught, reaching the application's top-level error handling - where standard except Exception: guards also fail - and terminates the Python process. A fully working proof-of-concept demonstrating all four variants (SystemExit, KeyboardInterrupt, GeneratorExit, and BaseException) is included in the public advisory, confirmed on asteval 1.0.6 with Python 3.11 and 3.12.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 20, 2026

Sandbox escape in asteval allows any attacker who can supply expressions to Interpreter.eval() to raise SystemExit, KeyboardInterrupt, GeneratorExit, or BaseException, bypassing both run() and eval() exception handlers - which catch only Exception - and terminating or disrupting the calling process. All asteval versions through 1.0.6 are affected; version 1.0.9 resolves the issue. No active exploitation has been confirmed (not in CISA KEV), but a working proof-of-concept covering all four variants is included in the public advisory GHSA-89v8-rhwq-hf77, and this is a third distinct sandbox-escape class in asteval following CVE-2025-24359 and GHSA-vp47-9734-prjw.

RemediationAI

Upgrade asteval to version 1.0.9, which removes BaseException, SystemExit, KeyboardInterrupt, and GeneratorExit from FROM_PY in astutils.py and adds explicit except (KeyboardInterrupt, SystemExit, GeneratorExit) handlers in run(), eval(), parse(), on_call(), and on_raise(), converting escaped exceptions into sandboxed RuntimeError instances. The patch is at https://github.com/lmfit/asteval/pull/153 (commit a3e56e7f8ed567a4817684d94213b290359077b4) and the release is at https://github.com/lmfit/asteval/releases/tag/1.0.9. If immediate upgrade is not possible, wrap all calls to aeval.eval() in except BaseException: rather than except Exception: - this is non-standard but contains the escape at the application boundary; be aware it will also suppress legitimate KeyboardInterrupt signals, which may break Ctrl-C handling. A secondary workaround is to remove the dangerous names from the interpreter symbol table after instantiation: for name in ('SystemExit', 'KeyboardInterrupt', 'GeneratorExit', 'BaseException'): aeval.symtable.pop(name, None) - this prevents name-based access but does not address the underlying handler gap and should not be considered a complete fix.

Affected VersionsENISA

asteval < 1.0.9

Affected Packages

pypi asteval fix: 1.0.9

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

asteval is a Python AST-based sandboxed expression evaluator used by scientific libraries such as lmfit. The root cause is CWE-248 (Uncaught Exception): FROM_PY in astutils.py (lines 89-108) imports BaseException, SystemExit, KeyboardInterrupt, and GeneratorExit into the sandbox symbol table. Python's exception hierarchy branches at BaseException into two disjoint subtrees - these four classes are direct children of BaseException but not of Exception, so except Exception: guards in run() (line 322) and eval() (line 370) are structurally unable to intercept them. When on_raise() processes a user raise statement, it calls raise_exception() with the raw class, which executes raise exc(msg) - and for the affected classes, this propagates unchecked through both handlers into the calling application. Affected package: pkg:pip/asteval, versions < 1.0.9.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/lmfit/asteval) PRIMARY 5.0 MEDIUM
AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H
vuln.today AI 7.5 HIGH

Network vector applies to the realistic worst-case deployment (web API accepting user expressions); no credentials or interaction required; impact is strictly process termination (A:H), no confidentiality or integrity effect.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE HIGH

Primary rating from Vendor (https://github.com/lmfit/asteval).

CVSS VectorVendor: https://github.com/lmfit/asteval

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

DescriptionCVE.org

Summary

An attacker who can supply expressions to asteval.Interpreter.eval() can raise SystemExit, KeyboardInterrupt, GeneratorExit, or BaseException from inside the sandbox. These exceptions are subclasses of BaseException but not Exception, so they bypass the except Exception: safety net in both run() and eval(). The exception propagates verbatim to the calling application, terminating the process or disrupting signal and cleanup handlers.

This is distinct from prior vulnerabilities CVE-2025-24359 (format string injection) and GHSA-vp47-9734-prjw (AST mutation TOCTOU), both fixed in 1.0.6. This vector is present in all versions including 1.0.6 and current HEAD.

---

Affected Code

asteval/astutils.py, lines 89-108 - FROM_PY exposes dangerous classes to sandbox users:

python
FROM_PY = ('ArithmeticError', 'AssertionError', 'AttributeError',
           'BaseException',
# ← escapes except Exception:
           'BufferError', 'BytesWarning',
           ...
           'GeneratorExit',
# ← escapes except Exception:
           ...
           'KeyboardInterrupt',
# ← escapes except Exception:
           ...
           'SystemExit',
# ← escapes except Exception:
           ...)

asteval/asteval.py, line 322 - run() exception handler:

python
except Exception:
# ← does NOT catch BaseException subclasses
    if with_raise and self.expr is not None:
        self.raise_exception(node, expr=self.expr)

asteval/asteval.py, line 370 - eval() exception handler:

python
except Exception:
# ← same gap
    if show_errors and not raise_errors:
        ...

asteval/asteval.py, line 264 - raise_exception() raises the class directly:

python
raise exc(self.error_msg)
# ← when exc=SystemExit, escapes both handlers above

---

Root Cause

Python's exception hierarchy has two distinct branches under BaseException:

BaseException
├── SystemExit          ← NOT caught by except Exception:
├── KeyboardInterrupt   ← NOT caught by except Exception:
├── GeneratorExit       ← NOT caught by except Exception:
└── Exception           ← caught normally
    ├── RuntimeError
    ├── ValueError
    └── ...

FROM_PY exposes all four non-Exception classes to sandbox users. When a user writes raise SystemExit("msg"), the on_raise() handler calls:

python
self.raise_exception(None, exc=out.__class__, msg=msg, expr='')

which executes raise SystemExit(msg). This propagates through both except Exception: guards unchecked and surfaces in the calling application.

---

Proof of Concept

python
from asteval import Interpreter
# Variant 1: terminate the process
aeval = Interpreter()
try:
    aeval.eval('raise SystemExit("terminated by sandbox user")')
except SystemExit as e:
    print(f"[CONFIRMED] SystemExit escaped: {e.code!r}")
# Variant 2: disrupt signal/finally handling
aeval = Interpreter()
try:
    aeval.eval('raise KeyboardInterrupt("interrupt injected")')
except KeyboardInterrupt as e:
    print(f"[CONFIRMED] KeyboardInterrupt escaped: {str(e)!r}")
# Variant 3: GeneratorExit
aeval = Interpreter()
try:
    aeval.eval('raise GeneratorExit("gen escape")')
except GeneratorExit as e:
    print(f"[CONFIRMED] GeneratorExit escaped: {str(e)!r}")
# Variant 4: BaseException base class
aeval = Interpreter()
try:
    aeval.eval('raise BaseException("base escape")')
except BaseException as e:
    if not isinstance(e, Exception):
        print(f"[CONFIRMED] BaseException escaped: {str(e)!r}")

Output (tested on asteval 1.0.6, Python 3.11/3.12):

[CONFIRMED] SystemExit escaped: 'terminated by sandbox user'
[CONFIRMED] KeyboardInterrupt escaped: 'interrupt injected'
[CONFIRMED] GeneratorExit escaped: 'gen escape'
[CONFIRMED] BaseException escaped: 'base escape'

Real-world server scenario

python
from asteval import Interpreter

def handle_request(user_expression):
    aeval = Interpreter()
    return aeval.eval(user_expression)
# SystemExit propagates here
# Attacker sends: raise SystemExit(1)
# Application terminates. Top-level except Exception: handlers do not protect it.
try:
    handle_request('raise SystemExit(1)')
except Exception:
    pass
# <-- does NOT catch SystemExit; process exits

---

Impact

VariantImpact
SystemExitProcess terminates; exit code and message attacker-controlled
KeyboardInterruptDisrupts finally blocks, signal handlers, and KeyboardInterrupt-aware loops
GeneratorExitDisrupts generator cleanup in calling code
BaseExceptionGeneric escape, same propagation

Any application that:

  • Accepts user-supplied expressions via asteval
  • Relies on except Exception: at the top level (standard practice)
  • Does not wrap aeval.eval() in except BaseException: (non-standard, unexpected requirement)

...is vulnerable to attacker-triggered process termination (DoS).

CVSS breakdown: Network-reachable (AV:N), no special conditions (AC:L), no credentials (PR:N), no interaction (UI:N), scope unchanged (S:U), no confidentiality/integrity impact (C:N/I:N), high availability impact - process termination (A:H).

---

Additional Note: File Read Capability (Acknowledged Limitation)

Independently of this vulnerability, asteval exposes a read-only open() wrapper (_open in astutils.py) that allows reading arbitrary files with the permissions of the calling process:

python
aeval.eval("open('/etc/passwd').read()")
# returns /etc/passwd contents

This is documented in doc/motivation.rst as a known design choice ("If reading from disk must be forbidden, you will want to overwrite the open() function from the symbol table"). It is included here for completeness, not as a separate advisory claim.

---

Recommended Fix

Option A - Remove dangerous classes from FROM_PY (minimal, preferred):

python
# asteval/astutils.py

FROM_PY = ('ArithmeticError', 'AssertionError', 'AttributeError',
# Remove: 'BaseException',
           'BufferError', 'BytesWarning',
           'DeprecationWarning', 'EOFError', 'EnvironmentError',
           'Exception', 'False', 'FloatingPointError',
# Remove: 'GeneratorExit',
           'IOError', 'ImportError', 'ImportWarning', 'IndentationError',
           'IndexError', 'KeyError',
# Remove: 'KeyboardInterrupt',
           'LookupError',
           'MemoryError', 'NameError', 'None',
           'NotImplementedError', 'OSError', 'OverflowError',
           'ReferenceError', 'RuntimeError', 'RuntimeWarning',
           'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError',
# Remove: 'SystemExit',
           'True', 'TypeError', ...)

Option B - Block non-Exception raises in on_raise():

python
# asteval/asteval.py

def on_raise(self, node):
    excnode = node.exc
    msgnode = node.cause
    out = self.run(excnode)
# Prevent BaseException subclasses from escaping the sandbox
    if not issubclass(out.__class__, Exception):
        self.raise_exception(node, exc=RuntimeError,
                             msg=f"raising {out.__class__.__name__!r} is not permitted")
        return
    msg = ' '.join(str(a) for a in out.args)
    msg2 = self.run(msgnode)
    if msg2 not in (None, 'None'):
        msg = f"{msg}: {msg2}"
    self.raise_exception(None, exc=out.__class__, msg=msg, expr='')

Note: Option B also fixes a secondary bug on the same line - ' '.join(out.args) crashes with TypeError when args contain non-strings (e.g., raise SystemExit(0) with integer code). The fix uses str(a) for a in out.args.

Option C - Catch BaseException in run() and eval() (broadest, requires care):

python
except BaseException as exc:
    if isinstance(exc, (SystemExit, KeyboardInterrupt, GeneratorExit)):
# Re-raise as RuntimeError to contain within sandbox
        self.raise_exception(node, exc=RuntimeError,
                             msg=f"{type(exc).__name__} raised in sandbox")
    elif with_raise and self.expr is not None:
        self.raise_exception(node, expr=self.expr)

Option A is the simplest and least likely to introduce regressions. Option B additionally addresses the str.join crash on integer args.

---

Disclosure Timeline

DateEvent
2026-06-09Vulnerability discovered during code review
2026-06-09Report submitted via GitHub Security Advisory
TBDMaintainer acknowledgment
TBD + 90 daysPublic disclosure deadline

---

Researcher

Independent security researcher. No bug bounty program exists for this project. CVE assignment requested via GitHub Security Advisory submission.

---

References

  • Prior CVE: CVE-2025-24359 (format string injection, fixed 1.0.6)
  • Prior advisory: GHSA-vp47-9734-prjw (AST mutation TOCTOU, fixed 1.0.6)
  • Python exception hierarchy: https://docs.python.org/3/library/exceptions.html#exception-hierarchy
  • asteval documentation: https://lmfit.github.io/asteval/

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 1 pypi packages depend on asteval (1 direct, 0 indirect)

Ecosystem-wide dependent count for version 1.0.9.

Threat Intelligence Overview

EPSS Score
0.2%
Top 93% exploitable
Prevalence
Low
niche scientific Python library, primarily used in lmfit ecosystem
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

45
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +25
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

SUSE

Severity: Important
Product Status
openSUSE Tumbleweed Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy