Skip to content
LangChainGHSA-rgp8-pm28-3759

langchain vulnerable to path traversal

Medium6.5CVE-2024-3571 · Published Apr 16, 2024 · updated Jul 7, 2026

langchain-ai/langchain is vulnerable to path traversal due to improper limitation of a pathname to a restricted directory ('Path Traversal') in its LocalFileStore functionality. An attacker can leverage this vulnerability to read or write files anywhere on the filesystem, potentially leading to information disclosure or remote code execution. The issue lies in the handling of file paths in the mset and mget methods, where user-supplied input is not adequately sanitized, allowing directory traversal sequences to reach unintended directories.

GitHub advisory

Affected versions

PackageAffectedFixed in
langchain
PyPI
< 0.0.3530.0.353
Details and references
CVSS 3.0
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Severity from
GitHub (reviewed advisory)
Weakness
CWE-22
Also known as
CVE-2024-3571, PYSEC-2026-1510

More LangChain advisories

All LangChain
Advisory
Server-Side Request Forgery in langchain-community.retrievers.web_research.WebResearchRetriever
Medium4.8Jun 6, 2024
LangChain's XMLOutputParser vulnerable to XML Entity Expansion
Medium5.9Mar 26, 2024
LangChain directory traversal vulnerability
LowMar 4, 2024
LangChain: server-side request forgery
Critical9.8Mar 1, 2024
LangChain Experimental vulnerable to arbitrary code execution
Critical9.8Feb 26, 2024
langchain Server-Side Request Forgery vulnerability
Low3.7Feb 26, 2024

Critical advisories by email

Wednesdays: the week’s critical and high advisories in the AI and data stack, with the fixed versions. Only in weeks that have some.

Double opt-in. Unsubscribe any time.