CVE-2025-24359
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 · uneditedASTEVAL 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 confidenceThe 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.
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 checksWork through these to decide whether this CVE applies to you.
-
Determine installed asteval versionRun 'pip show asteval' or 'pip list | grep asteval' to retrieve the installed version numberAffected if Version is lower than 1.0.6 (e.g., 1.0.5, 1.0.4, etc.)
-
Verify f-string parsing is in useInspect 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
-
Check for untrusted input pathsAudit code paths where user-supplied or external data flows into asteval's eval() or parse() functions without prior sanitizationAffected if Untrusted input can reach asteval's evaluation functions and trigger f-string processing
-
Inspect on_formattedvalue method implementationExamine 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
-
Verify exception handling behaviorTest whether triggering an AttributeError during f-string evaluation allows access to the exception object's obj attribute to reach protected propertiesAffected 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.
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 · scopedUpgrade 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.
asteval version 1.0.6
- Verify the current version of asteval installed in your environment by running: pip show asteval
- Upgrade asteval to version 1.0.6 or later by running: pip install --upgrade asteval>=1.0.6
- After upgrading, verify the installed version matches the fix: pip show asteval
- 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.
- Consultation1.0 h
- Implementation2.0 h
- Testing4.0 h
- Review / QA1.0 h
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 locallyCheck 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2025-24359 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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