Skip to main content

Checkov: ASTEVAL Allows Malicious Tampering of Exposed AST Nodes Leads to Sandbox Escape

0
High
Published: 08/13/2026 (08/13/2026, 16:39:32 UTC)
Source: GCVE Database
Product: checkov

Description

A vulnerability in the asteval library used by Checkov allows attackers who can control input to bypass safety checks and execute arbitrary Python code. The flaw arises because the attribute access verification can be circumvented by modifying AST nodes at runtime, exploiting a time-of-check to time-of-use (TOCTOU) issue. Specifically, the Procedure class exposes its AST in an unprotected attribute, enabling attackers to alter the AST and access dangerous dunder methods like __getattribute__. This leads to sandbox escape and arbitrary code execution within the application's context.

CVSS v3.1

Score 8.4high

Attack Vector
Local
Attack Complexity
Low
Privileges Required
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

Affected software

Homebrewmore threats →ghsa
checkov
pkg:brew/checkov
Affected versions
>=3.2.420 <3.2.490

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/18/2026, 01:37:40 UTC

Technical Analysis

The vulnerability in asteval stems from insufficient protection of the Procedure class's 'body' attribute, which holds AST nodes. The on_attribute handler attempts to block unsafe attribute access by checking if attributes are in UNSAFE_ATTRS or are dunder methods. However, an attacker can exploit a TOCTOU race condition by hooking the 'startswith' method on an AST node's attribute string to replace it with '__getattribute__' after the safety check but before the attribute is accessed. This allows bypassing the safety check and obtaining references to sensitive Python internals, enabling arbitrary code execution. A proof-of-concept demonstrates executing the 'whoami' command via this method.

Potential Impact

Successful exploitation allows an attacker to escape the asteval sandbox and execute arbitrary Python code with the privileges of the hosting application. This can lead to full compromise of the host system, including executing system commands, accessing sensitive data, and manipulating application behavior. The CVSS score of 8.4 reflects high confidentiality, integrity, and availability impacts with low attack complexity and no user interaction required.

Mitigation Recommendations

A patch is available for this vulnerability. Users should upgrade to a fixed version of the asteval library as incorporated in Checkov versions 3.2.490 and later. Until patched, avoid processing untrusted input with asteval or restrict usage contexts to trusted environments. Review vendor advisories for the official fix and apply updates promptly.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
BREW-checkov-GHSA-vp47-9734-prjw
Osv Schema Version
1.7.3
Ecosystems
["Homebrew"]
Cvss Version
3.1

Threat ID: 6aac8e1d55bf5e2cf549073b

Added to database: 09/18/2026, 01:04:29 UTC

Last enriched: 09/18/2026, 01:37:40 UTC

Last updated: 09/18/2026, 02:11:51 UTC

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses