{"id":"CVE-2024-7774","state":"PUBLISHED","title":"Path Traversal in langchain-ai/langchainjs","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.","publishedAt":"2024-10-29T12:49:21.165Z","updatedAt":"2024-10-29T13:31:38.566Z","severity":{"score":6.5,"label":"Medium","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","source":"@huntr_ai"},"assigner":"@huntr_ai","products":["langchain-ai langchain-ai/langchainjs"],"affected":[{"vendor":"langchain-ai","product":"langchain-ai/langchainjs","versions":[{"version":"unspecified","status":"affected","lessThan":"0.2.19","versionType":"custom"}]}],"references":["https://huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee","https://github.com/langchain-ai/langchainjs/commit/a0fad77d6b569e5872bd4a9d33be0c0785e538a9"],"weaknesses":["CWE-29"],"ingestedAt":"2026-10-29T20:08:20.985Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/7xxx/CVE-2024-7774.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2024-7774","state":"PUBLISHED","datePublished":"2024-10-29T12:49:21.165Z","dateUpdated":"2024-10-29T13:31:38.566Z","assignerShortName":"@huntr_ai","assignerOrgId":"c09c270a-b464-47c1-9133-acb35b22c19a","dateReserved":"2024-08-13T21:13:38.960Z"},"containers":{"cna":{"title":"Path Traversal in langchain-ai/langchainjs","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"langchain-ai","product":"langchain-ai/langchainjs","versions":[{"version":"unspecified","status":"affected","lessThan":"0.2.19","versionType":"custom"}]}],"references":[{"url":"https://huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee"},{"url":"https://github.com/langchain-ai/langchainjs/commit/a0fad77d6b569e5872bd4a9d33be0c0785e538a9"}],"metrics":[{"cvssV3_0":{"version":"3.0","attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"NONE","confidentialityImpact":"LOW","integrityImpact":"LOW","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","baseScore":6.5,"baseSeverity":"MEDIUM"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-29","type":"CWE","lang":"en","description":"CWE-29 Path Traversal: '\\..\\filename'"}]}],"providerMetadata":{"shortName":"@huntr_ai","orgId":"c09c270a-b464-47c1-9133-acb35b22c19a","dateUpdated":"2024-10-29T12:49:21.165Z"},"source":{"advisory":"8fe40685-b714-4191-af7a-3de5e5628cee","discovery":"EXTERNAL"}},"adp":[{"title":"CISA ADP Vulnrichment","affected":[{"vendor":"langchain-ai","product":"langchain-ai\\/langchainjs","defaultStatus":"unknown","versions":[{"version":"0","status":"affected","lessThan":"0.2.19","versionType":"custom"}],"cpes":["cpe:2.3:a:langchain-ai:langchain-ai\\/langchainjs:*:*:*:*:*:*:*:*"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2024-10-29T13:28:45.771600Z","id":"CVE-2024-7774","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-10-29T13:31:38.566Z"}}]}}}