CVE-2023-36188: LangChain: RCE via PALChain unsanitized Python exec
CRITICAL PoC AVAILABLE CISA: ATTENDAny application running LangChain ≤0.0.64 with PALChain exposed is fully compromised — no credentials needed, network-reachable, trivial to exploit. Patch to a fixed version immediately or disable PALChain entirely. If you can't patch now, add input validation to block code injection and restrict network access to the LangChain service.
Risk Assessment
Maximum exploitability: CVSS 9.8, zero authentication required, no user interaction, low complexity. PALChain passes user-controlled input directly to Python exec(), making this a textbook code injection. Exposure is high because LangChain was the dominant LLM framework at time of disclosure and PALChain was a commonly demonstrated feature. Any internet-facing service using LangChain PALChain is at critical risk of full host compromise.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| langchain | pip | — | No patch |
Do you use langchain? You're affected.
Severity & Risk
Attack Surface
Recommended Action
6 steps-
Patch: Upgrade LangChain to a version after 0.0.64 where PALChain input handling is corrected (PR #6003).
-
Workaround: Disable or remove PALChain from your application if not strictly needed.
-
Network hardening: Place LangChain services behind authentication and restrict to internal networks — this vulnerability requires no auth but network segmentation limits reachability.
-
Least privilege: Run LangChain processes with minimal OS permissions; no root, no write access to sensitive paths.
-
Detection: Monitor for unusual process spawning from Python processes, unexpected outbound connections, and anomalous exec() calls in application logs.
-
Audit: Inventory all LangChain versions in use via SCA tooling (Dependabot, Snyk, pip audit).
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2023-36188?
Any application running LangChain ≤0.0.64 with PALChain exposed is fully compromised — no credentials needed, network-reachable, trivial to exploit. Patch to a fixed version immediately or disable PALChain entirely. If you can't patch now, add input validation to block code injection and restrict network access to the LangChain service.
Is CVE-2023-36188 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2023-36188, increasing the risk of exploitation.
How to fix CVE-2023-36188?
1. Patch: Upgrade LangChain to a version after 0.0.64 where PALChain input handling is corrected (PR #6003). 2. Workaround: Disable or remove PALChain from your application if not strictly needed. 3. Network hardening: Place LangChain services behind authentication and restrict to internal networks — this vulnerability requires no auth but network segmentation limits reachability. 4. Least privilege: Run LangChain processes with minimal OS permissions; no root, no write access to sensitive paths. 5. Detection: Monitor for unusual process spawning from Python processes, unexpected outbound connections, and anomalous exec() calls in application logs. 6. Audit: Inventory all LangChain versions in use via SCA tooling (Dependabot, Snyk, pip audit).
What systems are affected by CVE-2023-36188?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, LLM application backends, RAG pipelines, chatbot infrastructure, AI-powered internal tools.
What is the CVSS score for CVE-2023-36188?
CVE-2023-36188 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 6.59%.
Technical Details
NVD Description
An issue in langchain v.0.0.64 allows a remote attacker to execute arbitrary code via the PALChain parameter in the Python exec method.
Exploitation Scenario
An adversary identifies a public-facing chatbot or internal AI assistant built on LangChain 0.0.64 using PALChain to answer math or logic questions. They craft a PALChain query containing embedded Python that exfiltrates environment variables (including OPENAI_API_KEY, database credentials, AWS keys) to an attacker-controlled endpoint. The payload is sent as a normal HTTP POST — no special access required. Within seconds, the attacker has obtained cloud credentials and API keys, pivots to exfiltrate the vector database, and establishes a reverse shell for persistence. The entire operation requires no LangChain or AI knowledge — just awareness of the exec() injection point.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H References
Timeline
Related Vulnerabilities
CVE-2025-2828 10.0 LangChain RequestsToolkit: SSRF exposes cloud metadata
Same package: langchain CVE-2023-34541 9.8 LangChain: RCE via unsafe load_prompt deserialization
Same package: langchain CVE-2023-29374 9.8 LangChain: RCE via prompt injection in LLMMathChain
Same package: langchain CVE-2023-34540 9.8 LangChain: RCE via JiraAPIWrapper crafted input
Same package: langchain CVE-2023-36258 9.8 LangChain: unauthenticated RCE via code injection
Same package: langchain
AI Threat Alert