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

Published Mar 20, 2025
·
Updated

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

4 affected componentsFixes available
langchain-ai langchain-core>=0.1.17<0.1.53, >=0.2.0<0.2.43, >=0.3.0<0.3.15
pip/langchain-core>=0.3.0<0.3.15
0.3.15
pip/langchain-core>=0.2.0<0.2.43
0.2.43
pip/langchain-core>=0.1.17<0.1.53
0.1.53

Event History

Mar 20, 2025
CVE Published
via MITRE·10:08 AM
Data Sourced
via MITRE·10:08 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:15 AM
DescriptionSeverityWeakness
Advisory Published
via GitHub·12:32 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-10940?

CVE-2024-10940 has a severity rating that indicates a significant risk of unauthorized file access.

2

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.

3

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.

4

What kind of access does CVE-2024-10940 allow?

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

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203