LangChainPublished 29 Oct 2024NVD status: Analyzed

CVE-2024-7774

A path traversal vulnerability exists in the getFullPath method of langchain-ai/langchainjs version 0.2.5.

ComponentLangChain (LangChain.js)
Severitycritical (CVSS 9.1)
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Published (NVD)2024-10-29
Last modified2026-06-17
Affected versions
< 0.2.19
from the GitHub-reviewed advisory GHSA-hc5w-c9f8-9cc4
Fixed in0.2.19
WeaknessCWE-29CWE-22
CISA KEVnot listed

Versions, checked against NVD

NVD's analysis reads = 0.2.5. The ranges above come from the GitHub-reviewed advisory GHSA-hc5w-c9f8-9cc4. The page and the scanner follow it: no more trusted source, and no two sources together, say otherwise (see the methodology).

NVD description

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.

What to do

  • Upgrade LangChain to 0.2.19 or later.
  • Do not expose the component's API or UI to the internet without authentication in front of it.

Sources