LangChain Core has Path Traversal vulnerabilites in legacy `load_prompt` functions
CVE-2026-34070 · GHSA-qh6h-p6c9-ff54 · published 2026-03-27 · updated 2026-03-31
- Severity
- High
- CVSS score
- 7.5
- Chance of exploitation (EPSS)
- 1.5%
- Fixed in
- 1.2.22
- Exploitation Public proof of concept
- Automatable Yes
- Technical impact Partial
- CISA SSVC
An attacker who controls or influences the prompt configuration dict can read files outside the intended directory: .txt files: cloud-mounted secrets (/mnt/secrets/apikey.txt), requirements.txt, internal system prompts .json/.yaml files: cloud credentials (~/.docker/config.json, ~/.azure/accessTokens.json), Kubernetes manifests, CI/CD configs, application settings This is exploitable in applications that accept prompt configs from untrusted sources, including low-code AI builders and API wrappers that expose loadpromptfromconfig().
Upgrade langchain-core to 1.2.22 or later. If you start it from an MCP config with npx or uvx, pin that version so an old cached copy is not used.
Update langchain-core to >= 1.2.22. The fix adds path validation that rejects absolute paths and .. traversal sequences by default. An allowdangerouspaths=True keyword argument is available on loadprompt() and loadpromptfromconfig() for trusted inputs. As described above, these legacy APIs have been formally deprecated. Users should migrate to dumpd/dumps/load/loads from langchain_core.load.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| langchain-core | PyPI | < 1.2.22 | 1.2.22 |
1 registered MCP server installs an affected version today, by the dependency versions a fresh install resolves.
- io.github.jahanv01/sec-intelligence-mcplangchain-core@0.3.86
- CriticalMCP Path Traversal Allows Full-Filesystem Read and JWT Secret Exfiltration Leading to Account Takeoverlangflow, langflow-base
- Critical@zereight/mcp-gitlab: Unauthenticated arbitrary file read via `upload_markdown` enables PAT exfiltration and full account takeover@zereight/mcp-gitlab
- CriticalFlowise RCE via SQL Database Chain Nodeflowise, flowise-components
- CriticalLangroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file callslangroid
- Criticalfast-mcp-telegram: Bearer token path traversal bypasses reserved Telegram session protectionfast-mcp-telegram
- CriticalMCP Toolbox HTTP tool path parameters allow traversal to unintended endpointsgithub.com/googleapis/mcp-toolbox
- CriticalLangChain serialization injection vulnerability enables secret extraction in dumps/loads APIslangchain-core, langchain-core
- HighLangChain vulnerable to unsafe deserialization of attacker-controlled objects through overly broad `load()` allowlistslangchain-core, langchain-core
- HighLangChain Vulnerable to Template Injection via Attribute Access in Prompt Templateslangchain-core, langchain-core
- MediumLangChain has incomplete f-string validation in prompt templateslangchain-core, langchain-core
- Mediumlangchain-core allows unauthorized users to read arbitrary files from the host file systemlangchain-core, langchain-core, langchain-core
- MediumLangChain's XMLOutputParser vulnerable to XML Entity Expansionlangchain-core
The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.