CVE-2024-10940langchain-ai/langchain
Medium 5.3 No auth needed
Follow: this CVE · langchain-ai · langchain-ai/langchain We alert you by email or Slack (account required).
- Priority
- 47
- CVSS 3.0
- 5.3
- EPSS
- 0.6% probability of exploitation in 30 days · percentile 41
- Auth required
- No
- Published
- Mar 20, 2025
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-497
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: yes · Technical impact: partial
- Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
What happens
A vulnerability in langchain-core versions >=0.1.17,<0.1.53, >=0.2.0,<0.2.43, and >=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 langchain_core.prompts.ImagePromptTemplate's (and by extension langchain_core.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.
What to do
- Apply the vendor's security update for langchain-ai/langchain.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| PyPI | langchain-core |
≥ 0.1.17 < 0.1.53 |
0.1.53 |
pip install "langchain-core>=0.1.53" |
| PyPI | langchain-core |
≥ 0.2.0 < 0.2.43 |
0.2.43 |
pip install "langchain-core>=0.2.43" |
| PyPI | langchain-core |
≥ 0.3.0 < 0.3.15 |
0.3.15 |
pip install "langchain-core>=0.3.15" |
| PyPI | langchain-core |
≥ 0.1.17 < 0.1.53 |
0.1.53 |
pip install "langchain-core>=0.1.53" |
| PyPI | langchain-core |
≥ 0.2.0 < 0.2.43 |
0.2.43 |
pip install "langchain-core>=0.2.43" |
| PyPI | langchain-core |
≥ 0.3.0 < 0.3.15 |
0.3.15 |
pip install "langchain-core>=0.3.15" |
Per OSV / GitHub Advisories (GHSA-5chr-fjjv-38qv, PYSEC-2026-1517). Check the version in your lockfile before upgrading.
Affected products
- langchain-ai · langchain-ai/langchain
As reported by the CNA that published the CVE. NVD has not added CPEs with versions yet.
Official sources
References
Links published by the sources. Open them with care.