CVE-2024-10940
JSON

5.3medium

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

Severity
5.3medium CVSS:3.0 by @huntr_ai
Exploit likelihood
0.40% (higher than 35% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
@huntr_ai
Also known as
GHSA-5chr-fjjv-38qvPYSEC-2026-1517

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

Product or packageVersionsReported by
langchain-ai langchain-ai/langchainfrom unspecified before 0.3.15CVE List
langchain-core (PyPI)from 0.1.17 before 0.1.53, from 0.2.0 before 0.2.43, from 0.3.0 before 0.3.15GitHub Advisory Database, PyPA Advisory Database

All scores

@huntr_ai5.3medium CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
GitHub5.3medium CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
PyPA Advisory Database5.3medium CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Classification

CWE-497

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

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.

NVD (es)

Una vulnerabilidad en las versiones de langchain-core &gt;=0.1.17, &lt;0.1.53, &gt;=0.2.0, &lt;0.2.43 y &gt;=0.3.0, &lt;0.3.15 permite a usuarios no autorizados leer archivos arbitrarios del sistema de archivos del host. El problema surge de la posibilidad de crear plantillas langchain_core.prompts.ImagePromptTemplate (y, por extensión, langchain_core.prompts.ChatPromptTemplate) con variables de entrada que pueden leer cualquier ruta especificada por el usuario desde el sistema de archivos del servidor. Si las salidas de estas plantillas de solicitud se exponen al usuario, ya sea directamente o a través de las salidas del modelo posterior, se puede exponer información confidencial.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-10940 changed 2025-03-20CVE Terms of Use
GitHub Advisory DatabaseGHSA-5chr-fjjv-38qv changed 2026-07-07CC-BY-4.0
NVDCVE-2024-10940 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-1517 changed 2026-07-07CC-BY-4.0