CVE-2025-24359

8.4 HIGH

📋 TL;DR

CVE-2025-24359 is a code execution vulnerability in the ASTEVAL Python library that allows attackers to bypass security restrictions and execute arbitrary Python code when they control input to the library. This affects any application using vulnerable versions of ASTEVAL to evaluate untrusted user input. The vulnerability exploits improper handling of formatted string AST nodes to access protected object attributes.

💻 Affected Systems

Products:
  • ASTEVAL Python library
Versions: All versions prior to 1.0.6
Operating Systems: All operating systems running Python
Default Config Vulnerable: ⚠️ Yes
Notes: Only vulnerable when processing untrusted input. Applications that use ASTEVAL with trusted input only are not affected.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full remote code execution leading to complete system compromise, data theft, and lateral movement within the environment.

🟠

Likely Case

Arbitrary code execution within the application context, potentially allowing data access, privilege escalation, or denial of service.

🟢

If Mitigated

Limited impact if input validation prevents malicious payloads from reaching the vulnerable function.

🌐 Internet-Facing: HIGH - If the vulnerable library processes user-controlled input from internet-facing applications.
🏢 Internal Only: MEDIUM - Lower risk if only internal users can provide input, but still dangerous if internal systems are compromised.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires understanding of Python AST nodes and exception handling. The advisory includes technical details but no ready-to-use exploit.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.0.6

Vendor Advisory: https://github.com/lmfit/asteval/security/advisories/GHSA-3wwr-3g9f-9gc7

Restart Required: No

Instructions:

1. Update ASTEVAL package: pip install --upgrade asteval==1.0.6
2. Verify no downgrades occur in dependency resolution
3. Test application functionality with the updated version

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement strict input validation to prevent malicious payloads from reaching the ASTEVAL evaluator.

Disable Formatted String Evaluation

all

Configure ASTEVAL to disable formatted string evaluation if not required by application functionality.

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all data passed to ASTEVAL functions
  • Isolate the vulnerable component in a sandboxed environment with minimal privileges

🔍 How to Verify

Check if Vulnerable:

Check installed ASTEVAL version: pip show asteval | grep Version

Check Version:

pip show asteval | grep Version

Verify Fix Applied:

Confirm version is 1.0.6 or higher: pip show asteval | grep Version

📡 Detection & Monitoring

Log Indicators:

  • Unusual Python exception patterns, particularly AttributeError exceptions in ASTEVAL context
  • Unexpected process execution from Python applications using ASTEVAL

Network Indicators:

  • Outbound connections from applications that shouldn't make network calls

SIEM Query:

Process creation events from Python processes with command lines containing suspicious Python code or ASTEVAL-related operations

🔗 References

📤 Share & Export