CVE-2026-34070: langchain-core: path traversal exposes host secrets via prompt config
GHSA-qh6h-p6c9-ff54 HIGH CISA: TRACK*Any LangChain application that accepts user-supplied prompt configurations is vulnerable to arbitrary file read — including cloud credentials, Kubernetes manifests, and CI/CD configs. Update langchain-core to >=1.2.22 immediately and audit all code paths calling load_prompt() or load_prompt_from_config() with external input. No authentication required, network-exploitable with CVSS 7.5 — treat as urgent if you run LangChain-based APIs or low-code AI builders.
What is the risk?
High risk. CVSS 7.5 with AV:N/AC:L/PR:N/UI:N means zero-click, unauthenticated, remote exploitation with trivial attack complexity. The file-extension constraint (.txt, .json, .yaml) limits scope but does not meaningfully reduce risk — cloud credential files, Docker configs, and Kubernetes manifests all fall within readable extensions. LangChain's massive adoption across enterprise AI stacks means blast radius is broad. Exploitation requires only the ability to influence a config dict passed to the affected functions, which is the design intent of low-code AI builders and API wrappers.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| langchain-core | pip | < 1.2.22 | 1.2.22 |
Do you use langchain-core? You're affected.
Severity & Risk
Attack Surface
What should I do?
7 steps-
PATCH
Update langchain-core to >=1.2.22 immediately — this is the only complete fix.
-
MIGRATE
Replace load_prompt()/load_prompt_from_config() with the new langchain_core.load serialization APIs (dumpd/dumps/load/loads), which use an allowlist model and perform no filesystem reads.
-
AUDIT
Grep codebase and dependencies for imports of langchain_core.prompts.loading — pay attention to third-party LangChain extensions.
-
NETWORK CONTROLS
Ensure prompt configuration endpoints are not exposed to untrusted users without authentication.
-
DETECTION
Alert on filesystem reads from LangChain process to sensitive paths (/root, /home/*/.*, /mnt/secrets, ~/.docker, ~/.azure, ~/.aws).
-
RUNTIME
Apply seccomp/AppArmor profiles to restrict file access from LangChain workers to intended directories only.
-
WORKAROUND (if patching is delayed): Validate all prompt config dicts server-side — reject any template_path, suffix_path, prefix_path, examples, or example_prompt_path containing '..' or starting with '/'.
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-2026-34070?
Any LangChain application that accepts user-supplied prompt configurations is vulnerable to arbitrary file read — including cloud credentials, Kubernetes manifests, and CI/CD configs. Update langchain-core to >=1.2.22 immediately and audit all code paths calling load_prompt() or load_prompt_from_config() with external input. No authentication required, network-exploitable with CVSS 7.5 — treat as urgent if you run LangChain-based APIs or low-code AI builders.
Is CVE-2026-34070 actively exploited?
No confirmed active exploitation of CVE-2026-34070 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-34070?
1. PATCH: Update langchain-core to >=1.2.22 immediately — this is the only complete fix. 2. MIGRATE: Replace load_prompt()/load_prompt_from_config() with the new langchain_core.load serialization APIs (dumpd/dumps/load/loads), which use an allowlist model and perform no filesystem reads. 3. AUDIT: Grep codebase and dependencies for imports of langchain_core.prompts.loading — pay attention to third-party LangChain extensions. 4. NETWORK CONTROLS: Ensure prompt configuration endpoints are not exposed to untrusted users without authentication. 5. DETECTION: Alert on filesystem reads from LangChain process to sensitive paths (/root, /home/*/.*, /mnt/secrets, ~/.docker, ~/.azure, ~/.aws). 6. RUNTIME: Apply seccomp/AppArmor profiles to restrict file access from LangChain workers to intended directories only. 7. WORKAROUND (if patching is delayed): Validate all prompt config dicts server-side — reject any template_path, suffix_path, prefix_path, examples, or example_prompt_path containing '..' or starting with '/'.
What systems are affected by CVE-2026-34070?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, LLM application frameworks, RAG pipelines, low-code AI builders, prompt management systems.
What is the CVSS score for CVE-2026-34070?
CVE-2026-34070 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.03%.
Technical Details
NVD Description
LangChain is a framework for building agents and LLM-powered applications. Prior to version 1.2.22, multiple functions in langchain_core.prompts.loading read files from paths embedded in deserialized config dicts without validating against directory traversal or absolute path injection. When an application passes user-influenced prompt configurations to load_prompt() or load_prompt_from_config(), an attacker can read arbitrary files on the host filesystem, constrained only by file-extension checks (.txt for templates, .json/.yaml for examples). This issue has been patched in version 1.2.22.
Exploitation Scenario
An attacker targets a SaaS AI platform built on LangChain that allows users to upload custom prompt templates via JSON configuration. They craft a malicious config with template_path set to /run/secrets/db_password.txt (a Docker secret) or examples set to ../../../../.aws/credentials. The platform passes this config directly to load_prompt_from_config() — a common pattern in low-code builders. The function reads the file without path validation and returns its contents as the prompt template, which is then echoed back in the API response or stored in a retrievable location. The attacker now has cloud credentials and proceeds to escalate to full infrastructure compromise. No special knowledge of AI/ML is required — only awareness of common cloud credential file paths.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N References
Timeline
Related Vulnerabilities
CVE-2026-44843 8.2 LangChain: deserialization poisons LLM chat history
Same package: langchain-core CVE-2025-68664 8.2 langchain-core: Deserialization enables RCE
Same package: langchain-core GHSA-926x-3r5x-gfhw 5.3 LangChain: f-string template injection exposes object internals
Same package: langchain-core CVE-2024-10940 5.3 langchain-core: file read via prompt template inputs
Same package: langchain-core CVE-2026-40087 5.3 LangChain: template injection leaks object attributes
Same package: langchain-core