Vulnerabilities · 2024 · Langchain
CVE-2024-7774
Langchain.js vulnerability
A path traversal vulnerability exists in the `getFullPath` method of langchain-ai/langchainjs version 0.2.5. This vulnerability allows attackers to save files anywhere in the filesystem, overwrite existing text files, read `.txt` files, and delete files. The vulnerability is exploited through the `setFileContent`, `getParsedFile`, and `mdelete` methods, which do not properly sanitize user input.
High priority: this vulnerability is rated critical and can be attacked over the network without a login.
Affected products
Langchain.js. The exact versions are in the references.
What to do now
- Check your exposureFind out whether Langchain.js runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Limit access until thenIf you cannot update at once, take the system off the internet or restrict who can reach it.
References
- github.com/langchain-ai/langchainjs/commit/a0fad77d6b569e5872bd4a9d33be0c0785e538a9 · Patch
- huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee · Exploit
- nvd.nist.gov/vuln/detail/CVE-2024-7774
- github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2024-111.yaml
- github.com/advisories/GHSA-hc5w-c9f8-9cc4
- nvd.nist.gov/vuln/detail/CVE-2024-7774
- cve.org/CVERecord?id=CVE-2024-7774
More vulnerabilities in Langchain products
CVE-2025-68665CVE-2025-68664CVE-2025-2828CVE-2024-58340CVE-2024-46946CVE-2024-38459CVE-2024-28088CVE-2024-27444All 34
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.