Skip to main content

asteval CVE-2026-102734

| EUVDEUVD-2026-98813 MEDIUM
Protection Mechanism Failure (CWE-693)
2026-10-13 GitHub_M
5.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Supply untrusted expression to asteval Interpreter
  2. Delivery
    Reach ctypes c_long type via numpy ndarray.ctypes.shape._type_
  3. Exploit
    Obtain target address using id() builtin
  4. Execution
    Read/write process memory via from_address
  5. Impact
    Corrupt memory to execute code or disclose secrets

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V15 - Secure Coding and Architecture Protection mechanism completeness
Exploitation Conditions

Requires asteval prior to 1.0.9 running its DEFAULT Interpreter with numpy installed/enabled (the default when numpy is present) and import disabled, where the host application passes an attacker-controlled expression string to Interpreter.eval(). No authentication to the sandbox, no user interaction, and no use of import, __dunder__ attributes, eval/exec, or getattr are needed - the chain uses only ordinary attribute access (ndarray.ctypes.shape._type_), the permitted id() builtin, ctypes from_address, and an ordinary attribute assignment. LIMITING FACTORS: exploitation is impossible if numpy is absent or the application never feeds untrusted input to asteval, and it is remediated entirely by upgrading to 1.0.9; the realistic attack surface (and effective attack vector) depends on how the consuming application exposes the expression input.

Impact

Signals conflict sharply and that conflict is the headline. The vendor CVSS is 5.5 (medium) with vector AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H - i.e. it was scored as a local, availability-only (crash/DoS) issue, which is reinforced by the 'Denial Of Service' tag. The GHSA advisory, however, documents a complete sandbox escape yielding an arbitrary in-process memory READ and WRITE primitive, explicitly equated to arbitrary code execution, secret disclosure, and memory corruption. That means the C:N/I:N portion of the vendor vector materially understates true impact (real impact is C:H/I:H/A:H), and the vulnerability should be triaged well above its 5.5 label for any environment that actually feeds untrusted expressions to asteval. Mitigating the alarm: no EPSS score was provided, there is no CISA KEV listing, and no evidence of active exploitation - so this is NOT a confirmed mass-exploited internet-facing bug. Its risk is sharply conditional: it only matters where an application passes attacker-controlled strings into asteval's default Interpreter with numpy present. SSVC inputs (exploitation/automatable/technical-impact) were not supplied. Net: a genuine high-priority sandbox escape for affected consumers despite the deceptively moderate CVSS, but not a drop-everything internet-wide emergency. The AV:L / UI:R choice is questionable - the sandbox's entire purpose is accepting untrusted (frequently remote) input, so verify the real attack surface per deployment.

Exploit ScenarioDerived

An application exposes a formula/expression field (e.g. a web calculator, report builder, or config evaluator) that passes user input to asteval's default Interpreter with numpy installed. An attacker submits a crafted expression that walks from a numpy array's .ctypes.shape._type_ to a ctypes c_long type, then uses the permitted id() builtin plus c_long.from_address(...).value to read arbitrary process memory and an unfiltered attribute assignment to write it. The GHSA advisory publishes the exact working technique, so a reliable, deterministic (AC:L) exploit requires no import, dunder, eval/exec, or getattr.

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

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

Alert me

AnalysisAIv1 – Oct 13, 2026

Sandbox escape in asteval (the lmfit restricted Python expression evaluator) before 1.0.9 lets an attacker-controlled expression turn numpy's ndarray.ctypes wrapper into an arbitrary process-memory read/write primitive, which is equivalent to code execution and can also leak secrets or crash the host process. Exploitation requires the DEFAULT Interpreter with numpy enabled (the default whenever numpy is installed) and a host application that evaluates untrusted expression strings; per the assessed vector it is unauthenticated (PR:N) with no user interaction and needs no import, __dunder__ access, eval, or getattr. The headline is a sharp signal conflict: NVD-style scoring gives only 5.5 (AV:L/AC:L/PR:N/UI:R, availability-only), while the independent assessment scores the same flaw CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H, so real-world risk depends entirely on how the consuming application exposes the evaluator. No public exploit code was identified at time of analysis, and the issue is fully remediated by upgrading to 1.0.9.

RemediationAI

Apply the vendor fix by upgrading to asteval 1.0.9 or later (pip install 'asteval>=1.0.9'; vendor-released patch: 1.0.9, delivered by PR #153 / commit a3e56e7f8ed567a4817684d94213b290359077b4 and tagged at https://github.com/lmfit/asteval/releases/tag/1.0.9), which blocks ndarray.ctypes, tofile, and dump via UNSAFE_ATTRS_DTYPES and converts KeyboardInterrupt/SystemExit/GeneratorExit escapes into RuntimeError; see GHSA-9w56-46f6-3qhx for details. Because there is no vendor patch for earlier releases, until upgrade restrict untrusted input to asteval in any process where numpy is importable; if that is not possible, construct the Interpreter with numpy disabled (minimal=True / an empty user symbol table) so ndarray.ctypes is unreachable, accepting the trade-off that evaluated expressions lose numpy support, and optionally remove numpy or shadow the ctypes module in the interpreter's environment - noting that identity-based module blocking is exactly the class of control that already failed here. Where the evaluator must stay numpy-enabled, run it in a separate low-privilege subprocess with OS-level confinement (seccomp/AppArmor/container) limiting memory and file access, and treat every evaluation as untrusted execution; disabling import alone is not a mitigation since the chain requires no import. Defense in depth: never evaluate user input in the same process that holds secrets or high-value memory.

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 purpose-built sandbox whose contract is 'untrusted string in, no arbitrary execution out', implemented as an AST-walking interpreter over Python expressions. Its defenses live in asteval/astutils.py: safe_getattr blocks every dunder attribute and refuses attribute values that are identity-equal to a module in UNSAFE_MODULES = {io, os, sys, ctypes}, and the symbol table controls which names (e.g. builtins like id) are visible. The root cause is CWE-693 (Protection Mechanism Failure): the ctypes check matches only the ctypes *module* object, not ctypes *type* objects or their metaclass methods, and attribute writes in Interpreter.node_assign use a raw setattr with no attribute-name filtering (there is no safe_setattr on the write path). Because numpy is enabled by default, zeros(1, dtype=int32).ctypes.shape._type_ resolves to <class 'ctypes.c_long'> using only ordinary, non-dunder names that are absent from UNSAFE_ATTRS; from there c_long.from_address(addr).value reads 8 bytes and assigning .value writes 8 bytes. The permitted id() builtin supplies object addresses, completing a full in-process read/write primitive that also reaches from_buffer, from_buffer_copy, from_param, and in_dll. The patch (PR #153, commit a3e56e7f8ed567a4817684d94213b290359077b4) closes both gaps by adding a per-type deny list UNSAFE_ATTRS_DTYPES[numpy.ndarray] = ('ctypes', 'tofile', 'dump') - also cutting off ndarray.tofile/dump file-write vectors - downgrading KeyboardInterrupt/SystemExit/GeneratorExit escaping into the sandbox to RuntimeError, and removing those exit exceptions from the permitted name table. Affected package is pip/asteval, CPE cpe:2.3:a:lmfit:asteval:*:*:*:*:*:*:*:* covering all releases before 1.0.9.

Know when Asteval 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 (GitHub_M) PRIMARY 5.5 MEDIUM
AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
vuln.today AI 10.0 CRITICAL

Arbitrary in-process memory read/write equals code execution and escapes the sandbox authority (C/I/A:H, S:C); the sandbox ingests unauthenticated attacker input deterministically (PR:N, UI:N, AC:L); AV:N assumes untrusted input arrives remotely.

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

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

Lifecycle Timeline

1
Patch available
Oct 13, 2026 - 17:03 EUVD

DescriptionCVE.org

asteval is a Python expression evaluator designed for restricted execution. Prior to 1.0.9, in asteval/astutils.py, the default Interpreter with numpy enabled exposes a ctypes type and permits from_address memory access. safe_getattr blocks the ctypes module but not reachable ctypes type objects, while attribute assignments use unfiltered setattr instead of safe_setattr. An attacker-controlled expression can derive an address with id, read memory through from_address, and write through an attribute assignment. The expression can read or corrupt arbitrary process memory, escape the intended sandbox, execute code, disclose secrets, or crash the host process. This issue is fixed in version 1.0.9.

Threat Intelligence Overview

EPSS Score
0.1%
Top 98% exploitable
Prevalence
Medium
popular scientific-Python expression evaluator (lmfit ecosystem), moderate real-world production footprint
Data Quality
6 sources
Confidence: High

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 No
EPSS 0.1%
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
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

28
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +28
PoC: 0
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.

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