# CVE-2025-24359: ASTEVAL Vulnerable to Maliciously Crafted Format Strings Leading to Sandbox Escape

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.4
- **CVSS:** 8.4 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.35% (percentile 21, 2026-11-26)
- **CWE:** CWE-134, CWE-749
- **Aliases:** GHSA-3wwr-3g9f-9gc7, PYSEC-2026-1195
- **Published:** 2025-01-24T16:52:44.304Z
- **Modified:** 2026-07-07T17:57:00.410Z

## Who should check

- Projects that depend on PyPI package asteval (\< 1.0.6)
- Anyone running lmfit asteval \< 1.0.6

## Description

ASTEVAL is an evaluator of Python expressions and statements. Prior to version 1.0.6, if an attacker can control the input to the \`asteval\` library, they can bypass asteval's restrictions and execute arbitrary Python code in the context of the application using the library. The vulnerability is rooted in how \`asteval\` performs handling of \`FormattedValue\` AST nodes. In particular, the \`on\_formattedvalue\` value uses the dangerous format method of the str class. The code allows an attacker to manipulate the value of the string used in the dangerous call \`fmt.format(\_\_fstring\_\_=val)\`. This vulnerability can be exploited to access protected attributes by intentionally triggering an \`AttributeError\` exception. The attacker can then catch the exception and use its \`obj\` attribute to gain arbitrary access to sensitive or protected object properties. Version 1.0.6 fixes this issue.

## Affected and fixed versions

- PyPI `asteval`: affected \< 1.0.6; fixed 1.0.6 (osv)
- lmfit asteval: \< 1.0.6 (cvelist)

## Mitigation

- Upgrade asteval to 1.0.6 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-24359. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-24359.md
Affected: asteval < 1.0.6
Fixed in: 1.0.6

Steps:
1. Search this machine and project for asteval (PyPI), lmfit asteval: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-24359 being exploited?

There is no confirmed exploitation: CVE-2025-24359 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.35% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-24359?

High: CVSS 8.4 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-24359?

asteval \< 1.0.6.

### Is there a fix for CVE-2025-24359?

Yes. Fixed in 1.0.6. Upgrade asteval to 1.0.6 or later.

### How do I check if I'm affected by CVE-2025-24359?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/lmfit/asteval/security/advisories/GHSA-3wwr-3g9f-9gc7>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2025-24359>
- vendor: <https://github.com/advisories/GHSA-3wwr-3g9f-9gc7>
- patch: <https://github.com/lmfit/asteval/commit/45bb47533f7abb5479618ae7f6a809215700dcb2>
- other: <https://github.com/lmfit/asteval/blob/cfb57f0beebe0dc0520a1fbabc35e66060c7ea71/asteval/asteval.py#L507>
- other: <https://lucumr.pocoo.org/2016/12/29/careful-with-str-format>
- other: <https://github.com/lmfit/asteval>
- other: <https://pypi.org/project/asteval>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-24359>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-3wwr-3g9f-9gc7> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2026-1195> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2025-24359> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-24359>
