{"id":"CVE-2024-3571","published":"2024-04-16T00:00:15Z","modified":"2024-08-01T20:12:07Z","title":"Path Traversal in langchain-ai/langchain","vendor":"langchain-ai","product":"langchain-ai/langchain","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.5,"severity":"MEDIUM","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01856,"percentile":0.79706,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://huntr.com/bounties/2df3acdc-ee4f-4257-bbf8-a7de3870a9d8","tags":[]},{"url":"https://github.com/langchain-ai/langchain/commit/aad3d8bd47d7f5598156ff2bdcc8f736f24a7412","tags":[]}],"priority":{"score":20.5,"factors":[{"name":"EPSS percentile","points":15.94},{"name":"CVSS severity","points":4.55}]},"vendorSlug":"langchain-ai","affectedVersions":[{"vendor":"langchain-ai","product":"langchain-ai/langchain","versions":[">= unspecified, < 0.0.353"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2024-06-17T19:16:15.831173Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"langchain","vulnerableRanges":["<0.0.353"],"patched":["0.0.353"],"from":["GHSA-rgp8-pm28-3759","PYSEC-2026-1510"],"provenance":"source"}],"summary":{"text":"A path traversal flaw exists in the LocalFileStore functionality of langchain-ai/langchain, where the mset and mget methods fail to adequately sanitize user-supplied file paths, letting directory traversal sequences reach directories outside the intended restricted location. An attacker with network access and low-privilege authentication, requiring no user interaction, can read or write files anywhere on the filesystem, which may lead to information disclosure or remote code execution.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:15:06Z"},"euvd":{"id":"EUVD-2024-1298","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2023-46229","published":"2023-10-19","fixed":"0.0.317","kev":false},{"cve":"CVE-2023-39659","published":"2023-08-15","fixed":"0.0.325","kev":false},{"cve":"CVE-2023-32786","published":"2023-10-20","fixed":"0.0.329","kev":false},{"cve":"CVE-2024-3571","published":"2024-04-16","fixed":"0.0.353","kev":false},{"cve":"CVE-2024-0243","published":"2024-02-24","fixed":"0.1.0","kev":false},{"cve":"CVE-2024-28088","published":"2024-03-03","fixed":"0.1.11","kev":false,"link":{"from":"CVE-2024-28088","to":"CVE-2024-3571","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:langchain","fromFixed":"0.0.339","toFixed":"0.0.353","daysApart":44}]}},{"cve":"CVE-2024-8309","published":"2024-10-29","fixed":"0.2.0","kev":false}],"package":"PyPI:langchain"}}