Incident report
LangChain PALChain Unsandboxed Python Exec Arbitrary Code Execution
CVE-2023-36258 disclosed critical remote code execution in LangChain's Program-Aided Language Model (`PALChain`) implementation prior to v0.0.236. `PALChain` prompts an LLM to synthesize Python helper functions for reasoning tasks and executes the emitted code via `exec()` in the application runtime. Prompt manipulation easily redirected generated Python functions to execute arbitrary shell commands and exfiltrate environment credentials. Following disclosure, the component was isolated behind explicit opt-in warnings and separated from untrusted production defaults.
Incident record
- Reported
- Severity
- Critical
- Vector
- Tool/MCP Abuse
- Affected system type
- Program-Aided Language Model Chains
- Reference
CVE-2023-36258- Reference URI
https://nvd.nist.gov/vuln/detail/CVE-2023-36258
Defensive lesson
Isolate Program-Aided LLM code execution inside ephemeral OS/WASM sandboxes with no network egress or secret environment variables.
Referenced techniques
- Command and Scripting Interpreter AML.T0050
- LLM Prompt Injection: Direct AML.T0051.000
- AI Agent Tool Invocation AML.T0053
- Generate Malicious Commands AML.T0102