Documented Incident · INC-2024-3271 · Critical severity

LlamaIndex Safe-Eval Wrapper Bypass Leading to Arbitrary Python Execution

CVE-2024-3271 documented a critical bypass of LlamaIndex's `safe_eval` utility inside its `PandasQueryEngine` structured query pipeline. Although `safe_eval` restricted obvious dangerous globals, crafted Python object traversal attributes generated via prompt injection escaped the restricted namespace and executed arbitrary system commands. Applications exposing CSV or DataFrame natural-language query assistants to end users risked full server takeover. Maintainers updated query execution guardrails, highlighting that Python `eval()` wrappers cannot safely isolate untrusted model strings.

Incident dossier metadata

Case ID
INC-2024-3271
Classification
Incident
Date
Severity
Critical
Sector
Software Development & AI Tooling
Attack vector
Tool/MCP Abuse
System type
Python RAG & Structured Query Orchestrators
CVE / reference
CVE-2024-3271
Reference URI
https://nvd.nist.gov/vuln/detail/CVE-2024-3271

Inspect INC-2024-3271 in Interactive Incidents & Cases Hub

Defensive takeaway

Eliminate Python eval() wrappers on model output entirely; replace expression helpers with strictly typed JSON tool schemas or isolated sandbox runtimes.

Mapped AI security techniques

Mapped defensive controls

Source citation records