Documented Incident · INC-2023-44467 · Critical severity
LangChain PythonAstREPLTool Sandbox Escape via Object Attribute Traversal
CVE-2023-44467 bypassed AST-level function allowlists in LangChain Experimental's `PythonAstREPLTool` (`<= 0.0.305`). By traversing standard Python dunder attributes such as `__subclasses__` or `__globals__` inside AST-checked expressions, prompt-injected scripts recovered restricted modules (`os`, `subprocess`) and executed arbitrary host commands. This demonstrated why in-process Python AST filtering cannot act as a security boundary against arbitrary code execution. Maintainers added attribute checks and moved interpreter execution toward explicit sandboxing.
Incident dossier metadata
- Case ID
INC-2023-44467- Classification
- Incident
- Date
- Severity
- Critical
- Sector
- Software Development & AI Tooling
- Attack vector
- Tool/MCP Abuse
- System type
- Python REPL & Code-Interpreter Agent Tools
- CVE / reference
CVE-2023-44467- Reference URI
https://nvd.nist.gov/vuln/detail/CVE-2023-44467
Defensive takeaway
Do not rely on Python AST filters or dunder-blocklists as an isolation boundary; run model-generated Python exclusively in OS-level sandboxes.
Mapped AI security techniques
- Command and Scripting Interpreter AML.T0050
- AI Agent Tool Invocation AML.T0053
- Virtualization/Sandbox Evasion AML.T0097
- Escape to Host AML.T0105
Mapped defensive controls
- Enforce Access Controls for AI Agent Tools AML.M0028
- Segmentation of AI Agent Components AML.M0032
- AI Red Team AML.M0035
Source citation records
- NVD Record CVE-2023-44467: LangChain PythonAstREPLTool Sandbox Escape · NIST National Vulnerability Database (NVD) ·