CVE-2024-10940: Exposure of Sensitive System Information via ImagePromptTemplate in langchain-ai/langchain
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 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. 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 Software
Event History
Frequently Asked Questions
What is the severity of CVE-2024-10940?
CVE-2024-10940 has a severity rating that indicates a significant risk of unauthorized file access.
How do I fix CVE-2024-10940?
To remediate CVE-2024-10940, upgrade langchain-core to version 0.1.53, 0.2.43, or 0.3.15.
What versions of langchain-core are affected by CVE-2024-10940?
CVE-2024-10940 affects langchain-core versions between 0.1.17 and 0.1.53, 0.2.0 and 0.2.43, as well as 0.3.0 and 0.3.15.
What kind of access does CVE-2024-10940 allow?
CVE-2024-10940 allows unauthorized users to read arbitrary files from the host file system.
Is there an alternative way to protect against CVE-2024-10940?
The most effective way to protect against CVE-2024-10940 is to ensure you are using a patched version of the langchain-core package.