Skip to content
Fencer Vulns
high 8.4

CVE-2025-24359 json

ASTEVAL Vulnerable to Maliciously Crafted Format Strings Leading to Sandbox Escape

published 2025-01-24 21 mo ago modified 2026-07-07 4 mo ago also GHSA-3wwr-3g9f-9gc7 , PYSEC-2026-1195 , EUVD-2025-0127

cvss
8.4
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.3%
EPSS 0.3% chance of exploitation in 30 days, percentile 20%
public exploits
0
none known

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.

Patch / fix

  • pypi asteval 1.0.6
  • python-asteval Debian 14, Debian 13 1.0.6-2

debian advisories DEBIAN-CVE-2025-24359

  • python-asteval Package Hub 15 SP6, openSUSE Leap 15.6 1.0.6-bp156.4.3.1
  • python-asteval openSUSE Tumbleweed 1.0.6-1.1

opensuse advisories openSUSE-SU-2025:0052-1openSUSE-SU-2025:14701-1

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2025-24359 updated cvss 8.4

python-asteval: ASTEVAL Vulnerable to Maliciously Crafted Format Strings Leading to Sandbox Escape

  • Red Hat All currently supported Red Hat products
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
Proof of concept is public
Automatable
no
Technical impact
total
Assessed
21 mo ago

Exploit prediction

0.28% chance of exploitation in the next 30 days, higher than 20% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 8.4 CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
OSV 3.1 8.4 CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub 3.1 8.4 CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
pypi asteval
<1.0.6
1.0.6

Affected products

  • lmfit asteval

Classification

Weakness
  • CWE-134 Use of Externally-Controlled Format String
  • CWE-749 Exposed Dangerous Method or Function

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.