Free AI Safety Workshop — in collaboration with explainx.aiSave your seat
AgentbeamBeta
AI agent vulnerability · LangChain

CVE-2024-10940: langchain-core allows unauthorized users to read arbitrary files from the host file system

mediumCVSS 3.0 5.3GHSA-5chr-fjjv-38qv

A vulnerability in langchain-core versions =0.1.17, =0.2.0, =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 langchaincore.prompts.ImagePromptTemplate's (and by extension langchaincore.prompts.ChatPromptTemplate's) with input variables that can read any user-specified path from the server file system.

Published Mar 20, 2025 · Updated May 20, 2025

Affected packages

langchain-core

Ecosystem
PyPI
Affected
>= 0.1.17, < 0.1.53
Fixed in
0.1.53
Check
pip show langchain-core

langchain-core

Ecosystem
PyPI
Affected
>= 0.2.0, < 0.2.43
Fixed in
0.2.43
Check
pip show langchain-core

langchain-core

Ecosystem
PyPI
Affected
>= 0.3.0, < 0.3.15
Fixed in
0.3.15
Check
pip show langchain-core

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to zly123987.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More LangChain vulnerabilities

All LangChain entries