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

Inspect INC-2023-44467 in Interactive Incidents & Cases Hub

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

Mapped defensive controls

Source citation records