PatchSiren cyber security CVE debrief
CVE-2026-34070 langchain-ai CVE debrief
LangChain Core versions prior to 1.2.22 contain a path traversal vulnerability in prompt loading functions. Multiple functions in `langchain_core.prompts.loading` read files from paths embedded in deserialized configuration dictionaries without validating against directory traversal sequences 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. File-extension checks exist but are insufficient: `.txt` for templates and `.json`/`.yaml` for examples do not prevent traversal outside intended directories. The vulnerability was published on 2026-03-31 and last modified on 2026-06-01. It is classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) with a CVSS 3.1 score of 7.5 (HIGH severity). The issue has been patched in langchain-core version 1.2.22. No known exploitation in ransomware campaigns has been documented.
- Vendor
- langchain-ai
- Product
- langchain
- CVSS
- HIGH 7.5
- CISA KEV
- Not listed in stored evidence
- Original CVE published
- 2026-03-31
- Original CVE updated
- 2026-08-25
- Advisory published
- 2026-03-31
- Advisory updated
- 2026-08-25
Who should care
Organizations running LangChain Core versions below 1.2.22 that accept user-influenced prompt configurations, particularly multi-tenant applications, SaaS platforms using LangChain, and systems processing untrusted prompt templates.
Technical summary
The vulnerability exists in `langchain_core.prompts.loading` where `load_prompt()` and `load_prompt_from_config()` deserialize configuration dictionaries containing file paths. These paths are used to read template files (.txt) and example files (.json/.yaml) without sufficient validation. An attacker can embed directory traversal sequences or absolute paths in the configuration to read arbitrary files from the host filesystem. The attack requires network access but no authentication, resulting in high confidentiality impact with no integrity or availability impact.
Defensive priority
HIGH
Recommended defensive actions
- Upgrade langchain-core to version 1.2.22 or later.
- Validate and sanitize all user-influenced prompt configuration inputs before passing to load_prompt() or load_prompt_from_config().
- Restrict file system permissions so the application process cannot access sensitive files outside intended prompt directories.
- Implement additional path validation to reject directory traversal sequences (e.g., ../) and absolute paths in configuration file references.
- Audit existing prompt configurations for unexpected file path references.
Evidence notes
Vulnerability confirmed through vendor security advisory and patch commit. Affected CPE: cpe:2.3:a:langchain:langchain_core:*:*:*:*:*:python:*:*, versions prior to 1.2.22. CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
Sources and references
Verified primary and authoritative sources
-
CVE-2026-34070 CVE Program record
Publisher, destination, and source semantics verified
URL: https://www.cve.org/CVERecord?id=CVE-2026-34070
CVE Program - Official CVE Program record with source-provided CVE metadata.
-
CVE-2026-34070 NVD vulnerability detail
Publisher, destination, and source semantics verified
URL: https://nvd.nist.gov/vuln/detail/CVE-2026-34070
NIST National Vulnerability Database - Official NIST NVD detail page and source-specific vulnerability assessment.
Supplemental references
-
Mitigation or vendor reference
Unverified legacy reference
URL: https://github.com/langchain-ai/langchain/commit/27add913474e01e33bededf4096151130ba0d47c
[email protected] - Patch
-
Mitigation or vendor reference
Unverified legacy reference
URL: https://github.com/langchain-ai/langchain/releases/tag/langchain-core==1.2.22
[email protected] - Release Notes
-
Mitigation or vendor reference
Unverified legacy reference
URL: https://github.com/langchain-ai/langchain/security/advisories/GHSA-qh6h-p6c9-ff54
[email protected] - Exploit, Vendor Advisory
Methodology and review provenance
AI-assisted synthesis based on stored public vulnerability evidence. System validation, approval state, and publication status do not by themselves establish human review of this revision. PatchSiren helps prioritize defensive review and does not prove exposure or remediation on any system.