CVE-2026-26019: @langchain/community affected by SSRF Bypass in RecursiveUrlLoader via insufficient URL origin validation
LangChain's @langchain/community 1.1.13 and earlier has an SSRF bypass in RecursiveUrlLoader. Its preventOutside check used a string prefix match, and the crawler never blocked private or metadata addresses. A crawled page can steer it to cloud metadata, internal services or localhost. Upgrade @langchain/community to 1.1.14.
Published Feb 11, 2026 · Updated Feb 12, 2026 · Analysis Nov 24, 2026
What an attacker can do
RecursiveUrlLoader is a crawler that follows links from a start URL. Its preventOutside option, on by default, is meant to keep it on the same site. The code compared URLs with String.startsWith(), which does no URL parsing. A link to example.com.attacker.com passes a prefix test against example.com, so the crawler follows it to an attacker's host.
Separately, the crawler did no check for private or reserved addresses. A crawled page could link to 169.254.169.254, localhost, or RFC 1918 ranges, and the crawler would fetch them (CWE-918).
The attacker needs to influence a page the crawler visits, for example a link on a public page, a forum post or other user-generated content. The crawler then fetches what the link points at. The advisory lists cloud metadata on AWS, GCP and Azure, which can expose IAM credentials and session tokens, internal services on 10.x, 172.16.x and 192.168.x, and localhost services. Response data can be pulled out through attacker-controlled redirect chains.
Most cloud-hosted deployments can reach such targets. The score is medium because the crawler must visit the attacker's content and the data must travel back to the attacker. The later bypass through redirects is tracked as CVE-2026-27795.
Who is affected
Affected: the npm package @langchain/community, version 1.1.13 and earlier. Version 1.1.14 is patched, though the redirect bypass in CVE-2026-27795 needs 1.1.18. Only code that uses RecursiveUrlLoader is exposed.
Check your version:
npm ls @langchain/communitySearch your code for RecursiveUrlLoader, and check whether the crawl start URL or crawled pages can be controlled by others.
@langchain/community
- Ecosystem
- npm
- Affected
- <= 1.1.13
- Fixed in
- 1.1.14
- Check
npm ls @langchain/community
How to fix it
Upgrade @langchain/community to 1.1.14 or later, and preferably to 1.1.18 or later to also close the redirect bypass:
npm install @langchain/community@latestThe fix replaces the prefix match with a strict origin comparison using the URL API, and adds an SSRF validation module from @langchain/core before every outbound fetch. It blocks metadata endpoints, private and loopback ranges, their IPv6 equivalents, and non-HTTP schemes. Metadata endpoints are blocked unconditionally.
If you cannot upgrade, the advisory says to avoid RecursiveUrlLoader on untrusted or user-influenced content, or to run the crawler on a network with no access to cloud metadata or internal services.
How to tell if you were hit
Check crawler host logs and proxy logs for outbound requests to 169.254.169.254, 100.100.100.200, metadata.google.internal, private ranges or localhost during crawls. Look for crawled links to hosts that begin with your target's name but belong to another domain. On cloud hosts, review metadata access and IAM credential use from unexpected places.
If a crawl may have fetched metadata, rotate the host role's credentials.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Description
The RecursiveUrlLoader class in @langchain/community is a web crawler that recursively follows links from a starting URL. Its preventOutside option (enabled by default) is intended to restrict crawling to the same site as the base URL.
The implementation used String.startsWith() to compare URLs, which does not perform semantic URL validation. An attacker who controls content on a crawled page could include links to domains that share a string prefix with the target (e.g., https://example.com.attacker.com passes a startsWith check against https://example.com), causing the crawler to follow links to attacker-controlled or internal infrastructure.
Additionally, the crawler performed no validation against private or reserved IP addresses. A crawled page could include links targeting cloud metadata services (169.254.169.254), localhost, or RFC 1918 addresses, and the crawler would fetch them without restriction.
Impact
An attacker who can influence the content of a page being crawled (e.g., by placing a link on a public-facing page, forum, or user-generated content) could cause the crawler to:
- Fetch cloud instance metadata (AWS, GCP, Azure), potentially exposing IAM credentials and session tokens
- Access internal services on private networks (
10.x,172.16.x,192.168.x) - Connect to localhost services
- Exfiltrate response data via attacker-controlled redirect chains
This is exploitable in any environment where RecursiveUrlLoader runs on infrastructure with access to cloud metadata or internal services — which includes most cloud-hosted deployments.
Resolution
Two changes were made:
- Origin comparison replaced. The
startsWithcheck was replaced with a strict origin comparison using the URL API (new URL(link).origin === new URL(baseUrl).origin). This correctly validates scheme, hostname, and port as a unit, preventing subdomain-based bypasses.
- SSRF validation added to all fetch operations. A new URL validation module (
@langchain/core/utils/ssrf) was introduced and applied before every outbound fetch in the crawler. This blocks requests to: - Cloud metadata endpoints:
169.254.169.254,169.254.170.2,100.100.100.200,metadata.google.internal, and related hostnames - Private IP ranges:
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.0/8,169.254.0.0/16 - IPv6 equivalents:
::1,fc00::/7,fe80::/10 - Non-HTTP/HTTPS schemes (
file:,ftp:,javascript:, etc.)
Cloud metadata endpoints are unconditionally blocked and cannot be overridden.
Workarounds
Users who cannot upgrade immediately should avoid using RecursiveUrlLoader on untrusted or user-influenced content, or should run the crawler in a network environment without access to cloud metadata or internal services.
Credited to kpanuragh, hntrl.
Questions
- Which @langchain/community version fixes CVE-2026-26019?
1.1.14. Versions up to 1.1.13 are affected. For the follow-up redirect bypass, CVE-2026-27795, you need 1.1.18 or later.
- Does preventOutside protect me?
Not in affected versions. It defaulted to true but compared URLs with a prefix match, so a domain that starts with your site's name passed. The fix uses a strict origin comparison.
- What if I cannot upgrade right away?
Avoid RecursiveUrlLoader on untrusted content, or run the crawler on a network with no route to cloud metadata or internal services. The advisory gives these two options and no complete workaround.
- Is CVE-2026-26019 exploited in the wild?
The sources do not say so. The entry has no CISA catalog data, and the EPSS score is about 0.4 percent.
References
Read for this analysis:
- https://github.com/langchain-ai/langchainjs/security/advisories/GHSA-gf3v-fwqg-4vh7
- https://github.com/langchain-ai/langchainjs/pull/9990
- https://github.com/langchain-ai/langchainjs/commit/d5e3db0d01ab321ec70a875805b2f74aefdadf9d
- https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain%2Fcommunity%401.1.14
- https://nvd.nist.gov/vuln/detail/CVE-2026-26019
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More LangChain vulnerabilities
All LangChain entriesCVE-2026-55443
LangChain: Path traversal and sandbox escape in LangChain file-search middleware and loaders
medium5.1Jun 16, 2026CVE-2026-45134
LangSmith SDK: Public prompt pull deserializes untrusted manifests without trust boundary warning
high7.1May 13, 2026CVE-2026-44843
LangChain vulnerable to unsafe deserialization of attacker-controlled objects through overly broad `load()` allowlists
high8.2May 8, 2026CVE-2026-40087
LangChain has incomplete f-string validation in prompt templates
medium5.3Apr 8, 2026CVE-2026-34070
LangChain Core has Path Traversal vulnerabilites in legacy `load_prompt` functions
high7.5Mar 27, 2026CVE-2026-27795
LangChain Community: redirect chaining can lead to SSRF bypass via RecursiveUrlLoader
medium4.1Feb 25, 2026
