Vulnerability · Published Mar 20, 2025 · Assigned by @huntr_ai

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

Medium 5.3

In plain English

A medium-severity security flaw in langchain-ai/langchain from langchain-ai. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 34% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.0)5.3Medium
Exploit odds (30 days)0.4%top 66.0% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
PyPIlangchain-core0.1.53GHSA-5chr-fjjv-38qv
PyPIlangchain-core0.2.43GHSA-5chr-fjjv-38qv
PyPIlangchain-core0.3.15GHSA-5chr-fjjv-38qv
PyPIlangchain-core0.1.53, 0.2.43, 0.3.15PYSEC-2026-1517

Affected products (as reported)

VendorProductVersions
langchain-ai langchain-ai/langchain unspecified – before 0.3.15

Weakness: CWE-497 · Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

References