Time-of-check Time-of-use (TOCTOU) Race Condition in asteval - #VU162971
Published: January 23, 2025 / Updated: November 9, 2026
Vulnerability details
The vulnerability allows an unprivileged local attacker to escape the asteval sandbox and execute arbitrary Python code in the application's context.
The vulnerability exists due to a time-of-check time-of-use flaw in asteval's attribute access validation when exposed function AST nodes are modified during evaluation. An unprivileged local attacker can supply crafted input that changes an attribute after validation to access restricted Python functionality and execute commands on the host.