Documented Incident · INC-2023-36258 · Critical severity
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 dossier metadata
- Case ID
INC-2023-36258- Classification
- Incident
- Date
- Severity
- Critical
- Sector
- Software Development & AI Tooling
- Attack vector
- Tool/MCP Abuse
- System type
- Program-Aided Language Model Chains
- CVE / reference
CVE-2023-36258- Reference URI
https://nvd.nist.gov/vuln/detail/CVE-2023-36258
Defensive takeaway
Isolate Program-Aided LLM code execution inside ephemeral OS/WASM sandboxes with no network egress or secret environment variables.
Mapped AI security 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
Mapped defensive controls
Source citation records
- NVD Record CVE-2023-36258: LangChain PALChain Arbitrary Code Execution · NIST National Vulnerability Database (NVD) ·