CVE-2026-55443: LangChain Path-Traversal File Access Vulnerability
LangChain versions prior to 1.3.9 contain a path-traversal vulnerability that allows unauthorized file access. Several components that load or search files do not properly restrict access to a configured directory boundary. An attacker who can influence file paths, search patterns, or LLM inputs could read files outside the intended scope—for instance, by using glob patterns, symbolic links, or prefix-matching tricks to escape a restricted directory and access sensitive files elsewhere on the system.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 5.1 MEDIUM · CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
- Weaknesses (CWE)
- CWE-22, CWE-59
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-22 / 2026-06-26
NVD description (verbatim)
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.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability stems from multiple path-handling failures across LangChain components: (1) file-search agent middleware validates the starting directory but does not constrain glob patterns or resolve symlink targets, allowing directory traversal; (2) prompt and chain/agent configuration loaders resolve path fields without enforcing a trusted base directory or rejecting symlinks; and (3) path-prefix authorization checks use string comparison without enforcing path-segment boundaries, permitting sibling directories with matching prefixes to bypass controls. The common thread is insufficient normalization and boundary validation. When an LLM, user, or external service provides path input, these flaws enable reads outside the intended root.
Business impact
Applications built with vulnerable LangChain versions risk exposure of sensitive files—configuration files, API keys, private data, or other secrets—if the LLM or user input is not independently validated. The severity depends on what files exist in accessible directories and what an LLM agent is permitted to do. For systems using LangChain agents to manage file operations in multi-tenant or untrusted-input scenarios, this is a meaningful data-loss risk. Lateral compromise or privilege escalation may follow if exposed credentials are present.
Affected systems
LangChain versions prior to 1.3.9 are affected. Any application or service using LangChain agents or configuration loaders that handle file paths is potentially impacted, particularly those that expose file-search or config-loading functionality to untrusted input or LLM-driven decisions.
Exploitability
Exploitation requires the ability to influence file paths or search patterns passed to LangChain components—either directly through user input, indirectly through an LLM agent acting on untrusted prompts, or via crafted workspace configuration. The CVSS score of 5.1 (MEDIUM) reflects that local access is typically required and exploitation depends on the application architecture, but the attack is practical and does not require special privileges or user interaction.
Remediation
Upgrade to LangChain 1.3.9 or later, which implements proper path normalization and confinement. Review your application's use of LangChain file-handling and agent components, especially where external or LLM-driven input influences file operations. Consider applying defense-in-depth: run agents with least-privilege filesystem access, validate and sanitize user input before passing it to LangChain, and use OS-level access controls to limit the blast radius.
Patch guidance
Update LangChain to version 1.3.9 or later. Verify the update through your package manager (pip, npm, or equivalent) and test file-handling components in a staging environment before production deployment. If you are using LangChain in a containerized or sandboxed environment, verify that the new version is pulled and deployed consistently across all instances.
Detection guidance
Monitor application logs for unusual file-access patterns, particularly searches or loads that attempt to access paths outside expected directories. If you have observability into LangChain agent execution, watch for glob patterns or symlink references in file-operation inputs. Filesystem-level monitoring can flag attempts to resolve paths beyond configured boundaries. Code review of LangChain usage should identify components that handle path inputs and assess whether those inputs are validated before reaching LangChain.
Why prioritize this
While the CVSS score is MEDIUM, the practical risk is elevated for any application that uses LangChain agents with untrusted input or LLM-driven automation. The vulnerability is not in the CISA KEV catalog, but it is straightforward to fix (a version upgrade), making it an efficient candidate for near-term patching. Prioritize based on whether your use of LangChain involves file operations and untrusted input.
Risk score, explained
The CVSS 3.1 score of 5.1 reflects: (1) local attack vector, limiting immediate exposure; (2) high complexity required (the application must use vulnerable components in a way that accepts untrusted input); but (3) high confidentiality impact once achieved. The score does not fully capture risk in scenarios where LLM agents are widely used to automate file operations, making it important to assess your specific application context beyond the base score.
Frequently asked questions
Can this vulnerability be exploited remotely?
Direct remote exploitation is unlikely because the CVSS vector specifies a local attack vector (AV:L). However, an attacker who can submit prompts or input to an LLM-powered application hosted on a vulnerable system could indirectly trigger the vulnerability. The risk depends on the network boundary of your application and whether untrusted actors can reach it.
Do I need to patch immediately if I use LangChain but do not use file-search or configuration-loading agents?
If your application does not invoke the vulnerable components (file-search middleware, path-based config loaders), your immediate risk is lower. However, upgrading to 1.3.9 is still recommended to avoid accidental exposure if application logic changes or new features are added later.
What is the difference between this and a typical directory-traversal vulnerability?
This vulnerability is unusual because it affects multiple independent path-handling functions in LangChain, each with a different flaw. Traditional directory-traversal exploits use ../ sequences; this one exploits glob patterns, symlinks, and prefix-matching logic, making it harder to detect with simple pattern matching.
Does this affect LangChain in production if I run agents in a sandboxed container?
Sandboxing reduces risk significantly by limiting filesystem access to the container. However, if the container has access to sensitive files or shared volumes, the vulnerability can still be exploited within that scope. Combine patching with strict least-privilege filesystem access as a defense-in-depth measure.
This analysis is based on the published CVE record and LangChain vendor advisory. No exploit code or weaponized proof-of-concept is provided. Organizations should verify patch availability and compatibility with their environment before deployment. Risk assessment should account for your specific use of LangChain components and the trust boundary of inputs to those components. This is informational content and should not be interpreted as a substitute for professional security assessment or vendor guidance. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-47277MEDIUMRuntipi Arbitrary File Read via Symlink in App Logo Endpoint
- CVE-2026-48776MEDIUMLangGraph SDK Path Traversal & Authorization Bypass
- CVE-2018-25393MEDIUMNavigate CMS 2.8.5 Path Traversal Vulnerability (CVSS 6.5)
- CVE-2018-25421MEDIUMOpen STA Manager 2.3 Path Traversal File Download Vulnerability
- CVE-2019-25734MEDIUMContact Form by WD CSRF & Local File Inclusion Vulnerability
- CVE-2019-25740MEDIUMJoomla com_jsjobs Arbitrary File Deletion Vulnerability
- CVE-2022-50953MEDIUMWordPress admin-word-count-column Plugin Local File Read Vulnerability
- CVE-2024-47263MEDIUMSynology Hyper Backup Path Traversal – Admin Privilege Required