Langchain Community SSRF Bypass Vulnerability Exposes Internal Services to Unauthorized Access
The Langchain development team has issued a critical security update for the @langchain/community package to mitigate a Server-Side Request Forgery (SSRF) vulnerability.
The Langchain development team has issued a critical security update for the @langchain/community package to mitigate a Server-Side Request Forgery (SSRF) vulnerability.
Identified as CVE-2026-26019, this flaw is located in the RecursiveUrlLoader class, a utility used for web crawling. Without the necessary patch, the vulnerability permits attackers to bypass domain restrictions and access internal network resources or sensitive cloud metadata.
The vulnerability stems from the manner in which the RecursiveUrlLoader validated URLs during crawling operations. The utility includes a preventOutside option, enabled by default, intended to restrict the crawler to the same domain as the starting URL. However, the implementation relied on a simple string comparison using String.startsWith() rather than a strict validation of the URL origin. This approach allowed attackers to construct a malicious domain that shares a prefix with the target domain, effectively bypassing the restriction.
Additionally, the previous version of the crawler did not validate against private or reserved IP addresses. This oversight enabled attackers to inject links leading to sensitive internal destinations, including cloud metadata services used by AWS, Google Cloud, and Azure. Accessing these metadata endpoints can lead to credential theft and potential compromise of cloud infrastructure. The crawler could also be manipulated to scan internal networks or access services running on localhost.
CVE ID CVSS Score Description
Identified as CVE-2026-26019, this flaw is located in the RecursiveUrlLoader class, a utility used for web crawling.
CVE-2026-26019 6.1 (Moderate) An SSRF bypass vulnerability in @langchain/community allows attackers to access internal services and cloud metadata via insufficient URL origin validation in the RecursiveUrlLoader class.
Package Affected Versions Patched Version
@langchain/community <= 1.1.13 1.1.14
The Langchain team addressed this vulnerability in version 1.1.14 through two key security enhancements. Firstly, the faulty string comparison is replaced with a strict origin check using the URL API, ensuring the scheme, hostname, and port match exactly. Secondly, a new SSRF validation module has been introduced, which runs before every outbound request and explicitly blocks connections to private IP ranges, local loopback addresses, and known cloud metadata endpoints such as 169.254.169.254 .
Developers using @langchain/community should upgrade to version 1.1.14 immediately. If an immediate upgrade is not feasible, it is advised to avoid running the RecursiveUrlLoader on untrusted user-generated content or deploy the application in an isolated network environment with restricted access to internal services and cloud metadata APIs.
Based on reporting by GBHackers.
