CVE-2025-24359ASTEVAL Vulnerable to Maliciously Crafted Format Strings Leading to Sandbox Escape
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.
What to do
Fixed builds are available from Debian, PyPI: see the table below for the fixed version per release.
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | python-asteval | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | python-asteval | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | python-asteval | Under investigation | UBUNTU-CVE-2025-24359 | |
| Ubuntu 22.04 | python-asteval | Under investigation | UBUNTU-CVE-2025-24359 | |
| Ubuntu 20.04 | python-asteval | Fix pending | UBUNTU-CVE-2025-24359 | |
| Debian 14 | python-asteval | Fixed | 1.0.6-2 | DEBIAN-CVE-2025-24359 |
| Debian 13 | python-asteval | Fixed | 1.0.6-2 | DEBIAN-CVE-2025-24359 |
| Debian 12 | python-asteval | Fix pending | DEBIAN-CVE-2025-24359 | |
| PyPI library | asteval | Fixed | 1.0.6 | PYSEC-2026-1195 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- lmfit asteval: affected: < 1.0.6
References
- https://github.com/lmfit/asteval/security/advisories/GHSA-3wwr-3g9f-9gc7
- https://github.com/lmfit/asteval/blob/cfb57f0beebe0dc0520a1fbabc35e66060c7ea71/asteval/asteval.py#L507
- https://lucumr.pocoo.org/2016/12/29/careful-with-str-format
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.