CVE-2024-10940
Exposure of Sensitive System Information via ImagePromptTemplate in langchain-ai/langchain
Also known as GHSA-5chr-fjjv-38qv, PYSEC-2026-1517
Mitigation
- Upgrade langchain-core to one of 0.1.53, 0.2.43, 0.3.15 (or later in the same release line).
Who should check
- Projects that depend on PyPI package langchain-core (>= 0.1.17, < 0.1.53)
- Anyone running langchain-ai/langchain >= unspecified, < 0.3.15
Vulnerability facts
- Affected
- langchain-core >= 0.1.17, < 0.1.53
- Fixed in
- 0.1.53, 0.2.43, 0.3.15
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 5.3 (v3.0, CNA)CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: Low
- Integrity impact: None
- Availability impact: None
- EPSS
- 0.57% chance of exploitation in 30 days (percentile 41, 2026-11-26)
- CWE
- CWE-497
- Modified
Description
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| PyPI langchain-core | >= 0.1.17, < 0.1.53 | 0.1.53, 0.2.43, 0.3.15 | osv |
| langchain-ai/langchain | >= unspecified, < 0.3.15 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-10940. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-10940.md Affected: langchain-core >= 0.1.17, < 0.1.53 Fixed in: 0.1.53, 0.2.43, 0.3.15 Steps: 1. Search this machine and project for langchain-core (PyPI), langchain-ai/langchain: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
FAQ
Is CVE-2024-10940 being exploited?
There is no confirmed exploitation: CVE-2024-10940 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.57% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-10940?
Medium: CVSS 5.3 (v3.0, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2024-10940?
langchain-core >= 0.1.17, < 0.1.53.
Is there a fix for CVE-2024-10940?
Yes. Fixed in 0.1.53, 0.2.43, 0.3.15. Upgrade langchain-core to one of 0.1.53, 0.2.43, 0.3.15 (or later in the same release line).
How do I check if I'm affected by CVE-2024-10940?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.