CVEfocus › CVE database › CVE-2025-24359

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

CVSS 8.4 HighEPSS 0.4% (higher than 21% of CVEs)Published 2025-01-24Updated 2025-02-12Assigner: GitHub_M

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.

CWE-134CWE-749

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

3Fixed
2Fix pending
2Under investigation
2Not affected

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04python-astevalNot affected
vulnerable_code_not_present
Ubuntu 25.10python-astevalNot affected
vulnerable_code_not_present
Ubuntu 24.04python-astevalUnder investigationUBUNTU-CVE-2025-24359
Ubuntu 22.04python-astevalUnder investigationUBUNTU-CVE-2025-24359
Ubuntu 20.04python-astevalFix pendingUBUNTU-CVE-2025-24359
Debian 14python-astevalFixed1.0.6-2DEBIAN-CVE-2025-24359
Debian 13python-astevalFixed1.0.6-2DEBIAN-CVE-2025-24359
Debian 12python-astevalFix pendingDEBIAN-CVE-2025-24359
PyPI libraryastevalFixed1.0.6PYSEC-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.

References

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.