CVE-2025-24359: ASTEVAL Vulnerable to Maliciously Crafted Format Strings Leading to Sandbox Escape
Vulnerability summary
CVE-2025-24359 is a high (CVSS 8.4) vulnerability in lmfit asteval. EPSS estimates a 0.28% chance of exploitation in the next 30 days, higher than 20.3% of scored vulnerabilities.
Not severe (CVSS 8.4, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Timeline
- 24-01-2025PublishedVulnerability first disclosed.
- 12-02-2025Last modifiedVulnerability information updated.
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.
CVSS metrics
5 scores · 5 sources · 1 version- OSV · PypiEcosystem advisory · calculated8.4HighCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · UbuntuEcosystem advisory · calculated8.4HighCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · DebianEcosystem advisory · calculated8.4HighCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- NVDNIST8.4HighCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS trend
Probability
0.28%
Chance of exploitation in the next 30 days
Percentile
20%
Versus all other CVEs
30-day change
No change 0.00 pp
From 0.28% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-134Use of Externally-Controlled Format StringThe product uses a function that accepts a format string as an argument, but the format string originates from an external source.
- CWE-749Exposed Dangerous Method or FunctionThe product provides an Applications Programming Interface (API) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted.
Affected systems
Known conditions: local access, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Opensuse2 products
- python-asteval&distro=openSUSE Leap 15.6< 1.0.6-bp156.4.3.1
- python-asteval&distro=openSUSE Tumbleweed< 1.0.6-1.1
Debian1 product
- python-astevalAll versions (No fix recorded) | < 1.0.6-2
Lmfit1 product
- asteval< 1.0.6
PyPI1 product
- asteval< 1.0.6
Suse1 product
- python-asteval&distro=SUSE Package Hub 15 SP6< 1.0.6-bp156.4.3.1
Ubuntu1 product
- python-astevalAll versions (No fix recorded)
6 vendors · 7 products
References
15 links- github.com/lmfit/asteval/blob/cfb57f0beebe0dc0520a1fbabc35e66060c7ea71/asteval/asteval.pyX Refsource MISCWEBREPORT
- lists.opensuse.org/archives/…Advisory
- github.com/lmfit/astevalPACKAGE
- pypi.org/project/astevalPACKAGE
Show all 15 references
- lists.opensuse.org/archives/…Advisory