langchain-core allows unauthorized users to read arbitrary files from the host file system
CVE-2024-10940 · GHSA-5chr-fjjv-38qv · published 2025-03-20 · updated 2025-05-20
- Severity
- Medium
- CVSS score
- 5.3
- Chance of exploitation (EPSS)
- 0.40%
- Fixed in
- 0.3.15
- Exploitation Public proof of concept
- Automatable Yes
- Technical impact Partial
- CISA SSVC
A vulnerability in langchain-core versions >=0.1.17, =0.2.0, =0.3.0,<0.3.15 allows unauthorized users to read arbitrary files from the host file system. The issue arises from the ability to create langchaincore.prompts.ImagePromptTemplate's (and by extension langchaincore.prompts.ChatPromptTemplate's) with input variables that can read any user-specified path from the server file system. If the outputs of these prompt templates are exposed to the user, either directly or through downstream model outputs, it can lead to the exposure of sensitive information.
Upgrade langchain-core to 0.3.15 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.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| langchain-core | PyPI | >= 0.1.17, < 0.1.53 | 0.1.53 |
| langchain-core | PyPI | >= 0.2.0, < 0.2.43 | 0.2.43 |
| langchain-core | PyPI | >= 0.3.0, < 0.3.15 | 0.3.15 |
- CriticalLiteLLM has SQL Injection in Proxy API key verificationlitellmExploited
- Criticaln8n Vulnerable to Remote Code Execution via Expression Injectionn8n, n8nExploited
- HighLiteLLM has a sandbox escape in custom-code guardraillitellmExploited
- HighLangflow affected by Remote Code Execution via validate_code() exec()langflowExploited
- CriticalJupyter MCP Server: Browser DNS rebinding can hijack the Jupyter backend through management routesjupyter-mcp-server
- Criticalmem0ai Databricks vector store vulnerable to SQL injectionmem0ai
- 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 Core has Path Traversal vulnerabilites in legacy `load_prompt` functionslangchain-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'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.