PyPI: langchain-core

CVE-2024-28088

Safety vulnerability ID: SFTY-20240304-45939

Safety legacy ID: pyup.io-71609

Affected versions of the LangChain package are vulnerable to Path Traversal due to improper sanitization of the path parameter in the `load_chain` call. The `load_chain` function allows user input to manipulate the final part of the path, enabling traversal outside the intended directory scope. An attacker can exploit this by crafting a path that accesses sensitive files, potentially leading to Information Disclosure of API keys or even Remote Code Execution if malicious scripts are executed.

Created at: Nov 5, 2025Updated at: Nov 5, 2025

Overview

LangChain directory traversal vulnerability

Advisory

Affected versions of the LangChain package are vulnerable to Path Traversal due to improper sanitization of the path parameter in the `load_chain` call. The `load_chain` function allows user input to manipulate the final part of the path, enabling traversal outside the intended directory scope. An attacker can exploit this by crafting a path that accesses sensitive files, potentially leading to Information Disclosure of API keys or even Remote Code Execution if malicious scripts are executed.

Affected Package

Affecting langchain-core package, versions
<0.1.30

Also affects

---

How to Fix

Upgrade
langchain-core
to
0.1.30
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more