INCIDENT MAP

Browse / AI Framework and Platform Flaws / CVE-2024-7774

Langchain Path Traversal vulnerability

CVE-2024-7774 ยท 2024-10-29 moderate

Class
AI Framework and Platform Flaws (filed by a model that read the advisory)
Technique
Path traversal and file access
Affected
langchain (npm)
CVSS
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
EPSS
0.6% chance of exploitation in 30 days

How it works, in short

A path helper does not sanitise user input, letting callers write, overwrite, read and delete files outside the intended directory. (Our summary, written by a model. The source text is below.)

Details

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.

References

Source: GitHub Advisory Database, used under CC BY 4.0.