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
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
- Command and Scripting Interpreter AML.T0050
- LLM Prompt Injection: Direct AML.T0051.000
- AI Agent Tool Invocation AML.T0053
- LLM Jailbreak AML.T0054
Mapped defensive controls
- Restrict Library Loading AML.M0011
- Enforce Access Controls for AI Agent Tools AML.M0028
- Segmentation of AI Agent Components AML.M0032
- Input and Output Validation for AI Agent Components AML.M0033
Source citation records
- NVD Record CVE-2024-3271: LlamaIndex PandasQueryEngine safe_eval Bypass RCE · NIST National Vulnerability Database (NVD) ·