Cyber Resilience

CVE-2024-7774

Path Traversal in Langchain.Js 0.2.5

Public PoCPath Traversal
Published
29 October 2024
Modified
28 May 2025
Patch / advisory
CVSS Score v3.1 9.1
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
EPSS Score 0.0055 43th percentile
Risk Priority 68 floored blend · peak EPSS

Summary

CVE-2024-7774 is a critical-severity Path Traversal: '\..\filename' (CWE-29) vulnerability in Langchain Langchain.Js. Its CVSS base score is 9.1 (Critical).

Operationally, exploitation aligns with the MITRE ATT&CK technique Exploit Public-Facing Application (T1190); ranked at the 43th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

This vulnerability is AI-related — categorised as AI Agent Protocols and Integrations; in the Other ATLAS/OWASP Terms risk domain.

The strongest mitigations our analysis identified map to AC-3 (Access Enforcement) and SI-10 (Information Input Validation) — see the control section below for these in your framework.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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…

more

`setFileContent`, `getParsedFile`, and `mdelete` methods, which do not properly sanitize user input.

CWE(s)

AI Security AnalysisAI

AI Category
AI Agent Protocols and Integrations
Risk Domain
Other ATLAS/OWASP Terms
OWASP Top 10 for LLMs 2025
None mapped
Classification Reason
LangChainJS (langchain-ai/langchainjs) is a framework for building AI applications, particularly LLM-powered agents, chains, and tool integrations, fitting 'AI Agent Protocols and Integrations'. The vulnerability is confirmed AI-related via AI/ML bug bounty context and explicit langchain-ai namespace.

Related Threats

MITRE ATT&CK Enterprise Techniques

T1190 Exploit Public-Facing Application Initial Access
Adversaries may attempt to exploit a weakness in an Internet-facing host or system to initially access a network.
T1005 Data from Local System Collection
Adversaries may search local system sources, such as file systems, configuration files, local databases, virtual machine files, or process memory, to find files of interest and sensitive data prior to Exfiltration.
T1083 File and Directory Discovery Discovery
Adversaries may enumerate files and directories or may search in specific locations of a host or network share for certain information within a file system.
T1552 Unsecured Credentials Credential Access
Adversaries may search compromised systems to find and obtain insecurely stored credentials.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2024-3571Same vendor: Langchain
CVE-2026-34070Same vendor: Langchain
CVE-2024-28088Same vendor: Langchain
CVE-2023-6831Shared CWE-22, CWE-29
CVE-2024-7962Shared CWE-22, CWE-29
CVE-2024-4320Shared CWE-22, CWE-29
CVE-2023-1177Shared CWE-22, CWE-29
CVE-2024-3573Shared CWE-22, CWE-29
CVE-2023-6023Shared CWE-22, CWE-29
CVE-2024-2928Shared CWE-22, CWE-29

Affected Assets

langchain
langchain.js
0.2.5

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)

Validate
Prove the fix (OWASP ASVS)
  • V5.3.2

Mitigating Controls (NIST 800-53 r5) AI

Enforces the intended directory access authorizations that path traversal would otherwise bypass.

Input validation directly neutralizes the '\..\filename' sequence before pathname resolution occurs.

Least privilege reduces the impact of any unauthorized file access obtained via traversal.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

Secure SDLC practices directly require input validation and path sanitization that block this traversal vector.

PR.PS-02 partial match
prevents

Patching/maintenance can remediate known path-traversal flaws in deployed software (partial prevention of exploitability) but does nothing to stop the coding defect from being introduced in the first place.

PR.AA-05 none match
prevents

PR.AA-05 defines and reviews access policies but does not address code-level pathname neutralization, so neither direction prevents CWE-22.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

Security testing can discover path-traversal flaws but does not itself prevent them in production code.

prevents

Secure SDLC mandates input validation and path sanitization that directly prevent path traversal.

prevents

Application security requirements can mandate input validation and path canonicalization to block traversal sequences.

prevents

Secure architecture principles include directory sandboxing and safe file-access design that mitigate path traversal.

prevents

Secure coding standards directly require neutralizing path traversal sequences such as '\..\filename'.

mitigates

Information access restriction limits which files an application may read or write.

References