Severity by source
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
LangChain apps typically accept malicious prompts over a network; AC:H for required filesystem knowledge and specific component deployment; no integrity or availability impact.
Primary rating from Vendor (GitHub_M).
CVSS VectorNVD
Lifecycle Timeline
4Blast Radius
ecosystem impact- 4 pypi packages depend on langchain (4 direct, 0 indirect)
- 1 pypi packages depend on langchain-anthropic (0 direct, 1 indirect)
Ecosystem-wide dependent count for version 1.3.9 and other introduced versions.
DescriptionNVD
LangChain is a framework for building agents and LLM-powered applications. Prior to 1.3.9, several LangChain components that resolve filesystem paths or expand search patterns do not consistently confine the resolved path to the intended root directory. Affected behaviors include: a file-search agent middleware that validates a starting directory but not the search pattern or the resolved target of matched files, so glob patterns and symlinks can reach files outside the configured root; prompt- and chain/agent-configuration loaders that accept path fields and resolve them without confining the result to a trusted base or rejecting symlink targets; and path-prefix authorization checks that compare by string prefix without a path-segment boundary, so a sibling path sharing the prefix is accepted. When these components receive path values, search patterns, or workspace contents influenced by an untrusted source - including an LLM acting on untrusted input - the result can be disclosure of files outside the intended boundary. This vulnerability is fixed in 1.3.9.
AnalysisAI
Path traversal and sandbox escape in LangChain prior to 1.3.9 allow untrusted inputs - including LLM-generated content steered by adversarial prompts - to escape a configured filesystem root boundary. Three components are affected: a file-search agent middleware that validates a starting directory but not glob patterns or symlink targets; prompt and chain/agent configuration loaders that resolve path fields without root confinement; and path-prefix authorization logic that performs string-prefix comparison without segment boundaries, allowing sibling paths to bypass access controls. No public exploit code has been identified at time of analysis and this CVE does not appear in CISA KEV, but the risk is meaningful for any deployment that exposes LangChain filesystem agents to untrusted user input or LLM prompt injection.
Technical ContextAI
LangChain (pip packages langchain and langchain-anthropic) is a Python framework for orchestrating LLM-based agents, chains, and tool-calling workflows. The vulnerability is a CWE-22 (Path Traversal) class defect with three distinct manifestations in the same codebase. First, FilesystemFileSearchMiddleware.glob_search validated the starting directory but forwarded the glob pattern to Path.glob without rejecting .. components or absolute paths, and enumerated matching files via rglob with followlinks=True (Python's default), allowing in-root symlinks pointing outside the root to be followed. Second, configuration loaders resolved path fields from untrusted YAML/JSON without calling Path.resolve() and comparing against a trusted base. Third, path-prefix authorization compared paths by string prefix rather than by normalized segment boundary, so /data/foo authorization could be bypassed by the path /data/foobar. The fix in commit dcaf7795 introduces _is_within_root() using Path.resolve().is_relative_to(), switches directory walking to os.walk(followlinks=False), rejects glob patterns starting with / or containing .. components, and applies containment checks post-symlink-resolution. Affected CPEs are cpe:2.3:a:langchain-ai:langchain:*:*:*:*:*:*:*:* and cpe:2.3:a:langchain-ai:langchain-anthropic:*:*:*:*:*:*:*:*.
RemediationAI
Vendor-released patch: langchain 1.3.9 and langchain-anthropic 1.4.6. Upgrade both packages immediately via pip install --upgrade langchain1.3.9 langchain-anthropic1.4.6. The fix is confirmed in commit dcaf7795a3e6590af55c3ff7bda6add6355e9ea6 and detailed in GHSA-gr75-jv2w-4656 (https://github.com/langchain-ai/langchain/security/advisories/GHSA-gr75-jv2w-4656). If patching is not immediately feasible, restrict filesystem-backed agent components to fully trusted, internally-generated inputs by removing any code paths that allow user-supplied prompts or LLM-generated content to influence path values, glob patterns, or configuration source paths. Disable the dangerous-loading opt-in flag in configuration loaders if it is enabled in production, as this flag bypasses symlink protections. Audit all deployments where FilesystemFileSearchMiddleware is used with a user-facing input channel, as these represent the highest-risk configuration. Applications that pass only first-party, trusted inputs to these components require no immediate action but should still be upgraded.
Code injection in Langflow CSV Agent node before 1.8.0. The node hardcodes allow_dangerous_code=True, enabling arbitrary
An issue in Harrison Chase langchain v.0.0.194 allows an attacker to execute arbitrary code via the python exec calls in
A remote code execution vulnerability in langchain-ai/langchain (CVSS 10.0). Risk factors: public PoC available. Vendor
A vulnerability in the GraphCypherQAChain class of langchain-ai/langchain version 0.2.5 allows for SQL injection through
A vulnerability in the GraphCypherQAChain class of langchain-ai/langchainjs versions 0.2.5 and all versions with this cl
langchain_experimental (aka LangChain Experimental) 0.1.17 through 0.3.0 for LangChain allows attackers to execute arbit
A vulnerability was found in LangChain langchain_community 0.0.26. Rated critical severity (CVSS 9.8), this vulnerabilit
An issue in LanChain-ai Langchain v.0.0.245 allows a remote attacker to execute arbitrary code via the evaluate function
An issue in langchain v.0.0.171 allows a remote attacker to execute arbitrary code via a JSON file to load_prompt. Rated
An issue in langchain langchain-ai v.0.0.232 and before allows a remote attacker to execute arbitrary code via a crafted
An issue in Harrison Chase langchain v.0.0.194 and before allows a remote attacker to execute arbitrary code via the fro
An issue in LangChain v.0.0.231 allows a remote attacker to execute arbitrary code via the prompt parameter. Rated criti
Same weakness CWE-22 – Path Traversal
View allSame technique Path Traversal
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-38332