# CVE-2026-102734: asteval sandbox escape: arbitrary native memory read/write via numpy ctypes in default asteval Interpreter

> Attackers can escape the asteval sandbox to read/write arbitrary memory and execute code via numpy ctypes in the default interpreter.

- **Severity:** Medium 5.5 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** No
- **Published:** 13 Oct 2026
- **Updated:** 13 Oct 2026
- **Also known as:** DEBIAN-CVE-2026-102734, GHSA-9w56-46f6-3qhx, UBUNTU-CVE-2026-102734

## What is CVE-2026-102734?

CVE-2026-102734 is a medium-severity code injection vulnerability in lmfit asteval, published on 13 Oct 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-913 (Improper Control of Dynamically-Managed Code Resources), CWE-749 (Exposed Dangerous Method or Function), CWE-693 (Protection Mechanism Failure)

## Which versions are affected by CVE-2026-102734?

2 open source packages ship an affected version, including asteval.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `asteval` | PyPI | All versions | 1.0.9 |
| `asteval` | PyPI | All versions | 1.0.9 |

## How do I fix CVE-2026-102734?

Upgrade asteval to 1.0.9 or later.

## Is CVE-2026-102734 being exploited?

There is no known exploitation of CVE-2026-102734 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-102734 and fix it if it is affected.

What it is: CVE-2026-102734 is a medium-severity code injection vulnerability in lmfit asteval, published on 13 Oct 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-102734 in the wild and no public exploit code.

Affected packages and fixed versions:
- asteval (PyPI): affected all versions; fixed in 1.0.9
- asteval (PyPI): affected all versions; fixed in 1.0.9

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-102734/ (Markdown: https://insights.sbomify.com/CVE-2026-102734/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-102734
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-102734
- OSV: https://osv.dev/vulnerability/CVE-2026-102734

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-102734/
Summaries are generated and may contain mistakes; the official description above is the record.
