fix(deps): update dependency @langchain/community to v1 [security]#213
fix(deps): update dependency @langchain/community to v1 [security]#213alithya-oss-backstage-ci[bot] wants to merge 1 commit into
Conversation
Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
1d24dc4 to
d4cce67
Compare
Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
Signed-off-by: Renovate Bot <bot@renovateapp.com>
d4cce67 to
0d8b571
Compare
Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
Renovate Ignore NotificationBecause you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR. |
This PR contains the following updates:
^0.3.26→^1.0.0@langchain/community affected by SSRF Bypass in RecursiveUrlLoader via insufficient URL origin validation
CVE-2026-26019 / GHSA-gf3v-fwqg-4vh7
More information
Details
Description
The
RecursiveUrlLoaderclass in@langchain/communityis a web crawler that recursively follows links from a starting URL. ItspreventOutsideoption (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.compasses astartsWithcheck againsthttps://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:
10.x,172.16.x,192.168.x)This is exploitable in any environment where
RecursiveUrlLoaderruns 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:169.254.169.254,169.254.170.2,100.100.100.200,metadata.google.internal, and related hostnames10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.0/8,169.254.0.0/16::1,fc00::/7,fe80::/10file:,ftp:,javascript:, etc.)Cloud metadata endpoints are unconditionally blocked and cannot be overridden.
Workarounds
Users who cannot upgrade immediately should avoid using
RecursiveUrlLoaderon untrusted or user-influenced content, or should run the crawler in a network environment without access to cloud metadata or internal services.Severity
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
LangChain Community: redirect chaining can lead to SSRF bypass via RecursiveUrlLoader
CVE-2026-27795 / GHSA-mphv-75cg-56wg
More information
Details
Summary
A redirect-based Server-Side Request Forgery (SSRF) bypass exists in
RecursiveUrlLoaderin@langchain/community. The loader validates the initial URL but allows the underlying fetch to follow redirects automatically, which permits a transition from a safe public URL to an internal or metadata endpoint without revalidation. This is a bypass of the SSRF protections introduced in 1.1.14 (CVE-2026-26019).Affected Component
@langchain/communityRecursiveUrlLoaderpreventOutside(default:true) is insufficient to prevent this bypass when redirects are followed automatically.Description
RecursiveUrlLoaderis a web crawler that recursively follows links from a starting URL. The existing SSRF mitigation validates the initial URL before fetching, but it does not re-validate when the request follows redirects. Because fetch follows redirects by default, an attacker can supply a public URL that passes validation and then redirects to a private network address, localhost, or cloud metadata endpoint.This constitutes a “check‑then‑act” gap in the request lifecycle: the safety check occurs before the redirect chain is resolved, and the final destination is never validated.
Impact
If an attacker can influence content on a page being crawled (e.g., user‑generated content, untrusted external pages), they can cause the crawler to:
10.x,172.16.x,192.168.x)This is exploitable in any environment where
RecursiveUrlLoaderruns with access to internal networks or metadata services, which includes most cloud-hosted deployments.Attack Scenario
Example redirector:
Root Cause
validateSafeUrl) is only performed on the initial URL.redirect: "follow"default), so the request can change destinations without additional validation.Resolution
Upgrade to
@langchain/community>= 1.1.18, which validates every redirect hop by disabling automatic redirects and re-validatingLocationtargets before following them.redirect: "manual").Locationis resolved and validated withvalidateSafeUrl()before the next request.Reources
Severity
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Release Notes
langchain-ai/langchainjs-community (@langchain/community)
v0.3.58Compare Source
v0.3.57Compare Source
v0.3.56Compare Source
v0.3.55Compare Source
v0.3.54Compare Source
v0.3.53Compare Source
v0.3.52Compare Source
v0.3.51Compare Source
v0.3.50Compare Source
v0.3.49Compare Source
v0.3.48Compare Source
v0.3.47Compare Source
v0.3.46Compare Source
v0.3.45Compare Source
v0.3.44Compare Source
v0.3.43Compare Source
v0.3.42Compare Source
v0.3.41Compare Source
v0.3.40Compare Source
v0.3.39Compare Source
v0.3.38Compare Source
v0.3.37Compare Source
v0.3.36Compare Source
v0.3.35Compare Source
v0.3.34Compare Source
v0.3.33Compare Source
v0.3.32Compare Source
v0.3.31Compare Source
v0.3.30Compare Source
v0.3.29Compare Source
v0.3.28Compare Source
v0.3.27Compare Source
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.