ASTEVAL Vulnerable to Maliciously Crafted Format Strings Leading to Sandbox Escape
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-134 and the CVSS impact.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| lmfit | asteval | before 1.0.6 | 1.0.6 | Patch available | CNA |
| — | asteval (PyPI) | before 1.0.6 | 1.0.6 | Patch available | GHSA-3wwr-3g9f-9gc7 |
- asteval Vendorlmfit Affected before 1.0.6 Fixed in 1.0.6 Patch available CNA
- asteval (PyPI) Vendor— Affected before 1.0.6 Fixed in 1.0.6 Patch available GHSA-3wwr-3g9f-9gc7
Remediation
- Fix · CNA asteval (lmfit) Fixed in 1.0.6
- Fix · GHSA-3wwr-3g9f-9gc7 asteval (PyPI) Fixed in 1.0.6 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2025-24359
- 2026-10-03 Alias added: GHSA-3wwr-3g9f-9gc7
References
Other 5
- 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
- https://github.com/lmfit/asteval/commit/45bb47533f7abb5479618ae7f6a809215700dcb2
- https://github.com/lmfit/asteval
More lmfit vulnerabilities
- TI-2026-39918 ASTEVAL: Sandbox Escape via BaseException Subclasses CVSS 3.1MEDIUM 5.0
- TI-2026-71827 Sandbox escape in asteval allows arbitrary process memory access CVSS 3.1MEDIUM 5.5
Sources
- CVE-2025-24359 · CVE Program
- CVE-2025-24359 · NVD
- FIRST EPSS
- GHSA-3wwr-3g9f-9gc7 · GitHub Advisory Database · CC BY 4.0
- CVE-2025-24359 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences