CVE-2026-27795: SSRF Bypass in @langchain/community's RecursiveUrlLoader
Summary
CVE-2026-27795: LangChain Community: redirect chaining can lead to SSRF bypass via RecursiveUrlLoader. Affects @langchain/community versions < 1.1.18. Fixed in 1.1.18. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The @langchain/community package is a library designed for building applications that utilize language models. It includes various components for web crawling and data fetching, one of which is the RecursiveUrlLoader. This component is intended to follow links from a starting URL recursively. However, it has a vulnerability that allows attackers to exploit redirect chains, leading to potential Server-Side Request Forgery (SSRF) attacks.
Vulnerability Detail
A redirect-based Server-Side Request Forgery (SSRF) bypass exists in the RecursiveUrlLoader component of the @langchain/community package. The loader initially validates the URL but fails to revalidate during automatic redirects. This oversight allows attackers to redirect from a safe public URL to internal or sensitive endpoints, potentially exposing credentials or accessing private network services. The vulnerability stems from a 'check-then-act' gap in the request lifecycle, where safety checks are only performed on the initial URL, leaving subsequent redirects unvalidated.
How To Fix
Minimum fixed version
1.1.18
This is the first release that contains the fix.
npm install @langchain/community@1.1.18
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can disable automatic redirects in your fetch requests by setting the redirect option to 'manual'. This will require you to handle redirects manually and validate each location before proceeding.
Conclusion
The CVE-2026-27795 vulnerability in the @langchain/community package's RecursiveUrlLoader poses a significant risk due to its SSRF bypass capabilities. It is crucial to upgrade to the patched version to mitigate potential threats and ensure the security of applications utilizing this package.
See every vulnerability recorded for @langchain/community →
FAQ
Server-Side Request Forgery (SSRF) is a vulnerability that allows an attacker to send crafted requests from a vulnerable server to internal or external resources, potentially leading to unauthorized access to sensitive data.
An attacker can exploit this vulnerability by providing a public URL that redirects to an internal service or metadata endpoint, allowing them to access sensitive information.
The impacts include unauthorized access to cloud instance metadata, internal services on private networks, and the ability to exfiltrate data through controlled redirects.
Yes, upgrading to version 1.1.18 or higher of the @langchain/community package addresses this vulnerability.
You can use Vulert, which monitors open-source vulnerabilities in your software. By analyzing your package-lock.json file, it can alert you to any vulnerabilities, including this one. You can also check your application using the Vulert playground without signing up.
References
Related vulnerabilities
Recent vulnerabilities recorded for @langchain/community.