Packages / langchain / Security
Langchain Path Traversal vulnerability
Affected releases · langchain
- 0.2.x0.2.0 – 0.2.18Fixed in 0.2.19
- 0.1.x and older0.0.1 – 0.1.37No fix, no longer updated
On 0.2.x, the newest line:
npm install langchain@0.2.19Every release on a timeline
Not affected
1.0.0 – 1.6.7
95 releases, latest
Affected
0.0.1 – 0.2.18
269 releases
Fixed
0.2.19 – 0.3.37
40 releases
What happens
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.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.