| Component | LangChain |
| Severity | high (CVSS 8.1) |
| CVSS vector | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N |
| Published (NVD) | 2024-03-04 |
| Last modified | 2026-06-17 |
| Affected versions | langchain < 0.1.12 |
| Fixed in | 0.1.12 |
| Weakness | CWE-22CWE-31 |
| CISA KEV | not listed |
NVD description
LangChain through 0.1.10 allows ../ directory traversal by an actor who is able to control the final part of the path parameter in a load_chain call. This bypasses the intended behavior of loading configurations only from the hwchase17/langchain-hub GitHub repository. The outcome can be disclosure of an API key for a large language model online service, or remote code execution. (A patch is available as of release 0.1.29 of langchain-core.)
What to do
- Upgrade LangChain to
0.1.12or later. - Do not expose the component's API or UI to the internet without authentication in front of it.
Sources
- NVD: CVE-2024-28088
- https://github.com/langchain-ai/langchain/pull/18600
- https://github.com/PinkDraconian/PoC-Langchain-RCE/blob/main/README.md
- https://github.com/langchain-ai/langchain/blob/f96dd57501131840b713ed7c2e86cbf1ddc2761f/libs/core/langchain_core/utils/loading.py
Other LangChain CVEs
LangChain is a framework for building LLM-powered applications. Prior to 1.1.1, @langchain/redis does not escape attacker-controlled values...
LangChain is a framework for building LLM-powered applications. Prior to 1.3.1, MongoDBChatMessageHistory does not enforce the documented st...
The OpenAI-compatible file upload endpoint `/v1/files` in Langchain-Chatchat 0.3.0 is vulnerable to path traversal. An attacker can write fi...
The /knowledge_base/upload_temp_docs temporary document upload endpoint in Langchain Chatchat 0.3.1 is vulnerable to path traversal. By craf...
The knowledge base creation and document upload interfaces in Langchain-Chatchat 0.3.0;0.3.1 is vulnerable to path traversal. An attacker ca...
LangChain MongoDB provides integrations between MongoDB, Atlas, LangChain, and LangGraph. Prior to langgraph-checkpoint-mongodb 0.3.0 and la...