Directory Traversal Vulnerability in LangChain Affects User Configurations
CVE-2026-34070
Key Information:
- Vendor
Langchain-ai
- Status
- Vendor
- CVE Published:
- 31 March 2026
Badges
What is CVE-2026-34070?
LangChain, a framework for developing agents and large language model (LLM) applications, was found to contain a directory traversal vulnerability prior to version 1.2.22. This flaw exists in the langchain_core.prompts.loading module, where multiple functions read configuration files from paths without proper validation. Consequently, if an application uses user-influenced prompt configurations with the load_prompt() or load_prompt_from_config() functions, an attacker can exploit this vulnerability to access arbitrary files on the host filesystem. The exploitation is limited primarily by file extension checks (e.g., .txt for templates and .json/.yaml for examples). A fix has been implemented in version 1.2.22 to mitigate this risk.
Affected Version(s)
langchain < 1.2.22
Exploit Proof of Concept (PoC)
PoC code is written by security researchers to demonstrate the vulnerability can be exploited. PoC code is also a key component for weaponization which could lead to ransomware.
