CWE-134Weakness · CWE-134

CVE-2025-24359

HIGH · 8.4 CVSS v3.1 Published 2025-01-24
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
89/100
Remediation priority · High
No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

The asteval library prior to 1.0.6 fails to properly restrict code execution when handling FormattedValue AST nodes. The on_formattedvalue method uses a dangerous pattern: fmt.format(__fstring__=val), where an attacker-controlled input can manipulate the format string. By intentionally triggering AttributeError exceptions, attackers exploit the exception's obj attribute to bypass asteval restrictions and access protected/sensitive object properties, achieving arbitrary code execution.

MitigationUpgrade asteval to version 1.0.6 or later. If immediate upgrade is not possible, audit any code paths where untrusted input reaches asteval's eval/parse functions and implement input validation layers.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Local
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Determine installed asteval version
    Run 'pip show asteval' or 'pip list | grep asteval' to retrieve the installed version number
    Affected if Version is lower than 1.0.6 (e.g., 1.0.5, 1.0.4, etc.)
  2. Verify f-string parsing is in use
    Inspect code that uses asteval for any f-strings (formatted string literals) or FormattedValue AST node processing passed to asteval.eval() or asteval.parse()
    Affected if Code passes f-strings containing expressions to asteval for evaluation with untrusted or attacker-controlled input
  3. Check for untrusted input paths
    Audit code paths where user-supplied or external data flows into asteval's eval() or parse() functions without prior sanitization
    Affected if Untrusted input can reach asteval's evaluation functions and trigger f-string processing
  4. Inspect on_formattedvalue method implementation
    Examine the asteval source code in the library installation directory for the on_formattedvalue method; look for the pattern fmt.format(__fstring__=val)
    Affected if The vulnerable fmt.format(__fstring__=val) pattern is present in the source code
  5. Verify exception handling behavior
    Test whether triggering an AttributeError during f-string evaluation allows access to the exception object's obj attribute to reach protected properties
    Affected if AttributeError exceptions expose internal object properties through the exception handler

A system is affected if asteval version is below 1.0.6 AND untrusted input containing f-strings can reach asteval's eval or parse functions, enabling manipulation of the format string in on_formattedvalue to achieve arbitrary code execution.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade asteval to version 1.0.6 or later. If immediate upgrade is not possible, audit any code paths where untrusted input reaches asteval's eval/parse functions and implement input validation layers.

Recommended fix High confidence

asteval version 1.0.6

  1. Verify the current version of asteval installed in your environment by running: pip show asteval
  2. Upgrade asteval to version 1.0.6 or later by running: pip install --upgrade asteval>=1.0.6
  3. After upgrading, verify the installed version matches the fix: pip show asteval
  4. If your application uses asteval, test that legitimate functionality still works correctly after the upgrade

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation1.0 h
  • Implementation2.0 h
  • Testing4.0 h
  • Review / QA1.0 h
8.0 hours of engineering $1,340
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,144.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2025-24359 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2025-24359 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data