PyPI: langchain

CVE-2024-3571

Safety vulnerability ID: SFTY-20240416-22286

Safety legacy ID: pyup.io-71615

Affected versions of the langchain package are vulnerable to Path Traversal due to improper limitation of a pathname to a restricted directory in the langchain.storage.file_system.LocalFileStore component. The langchain.storage.file_system.LocalFileStore.mset and mget methods derive filesystem paths from a user-supplied key without ensuring the resolved path remains within the configured root, permitting absolute paths to escape the intended directory.

Created at: Nov 6, 2025Updated at: Nov 6, 2025

Overview

langchain vulnerable to path traversal

Advisory

Affected versions of the langchain package are vulnerable to Path Traversal due to improper limitation of a pathname to a restricted directory in the langchain.storage.file_system.LocalFileStore component. The langchain.storage.file_system.LocalFileStore.mset and mget methods derive filesystem paths from a user-supplied key without ensuring the resolved path remains within the configured root, permitting absolute paths to escape the intended directory.

Affected Package

Affecting langchain package, versions
<0.0.353

Also affects

---

How to Fix

Upgrade
langchain
to
0.0.353
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