/

CVE-2026-72848

Severity:

HIGH RISK

(8.6)

SSRF (CWE-918) in LangChain Community SitemapLoader Component

CVE-2026-72848

Awaiting Analysis

Vulnerability type

Category:

Server-Side Request Forgery

CWE:

CWE-918

Impact:

Internal service access and sensitive information disclosure

Severity:

HIGH RISK

(8.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A server-side request forgery (SSRF) vulnerability in LangChain Community's SitemapLoader allows nested sitemap URLs to bypass the configured same-domain restriction. If an attacker can control or influence an ingested sitemap, the server may request internal or otherwise restricted destinations and return their responses in the resulting Documents.

Affected context

The issue occurs when SitemapLoader.parse_sitemap processes nested sitemap elements while restrict_to_same_domain is enabled. Leaf URL entries are subject to domain filtering, but nested sitemap locations are passed to the scraping workflow without equivalent domain validation or checks against private, loopback, and link-local destinations. Deployments that ingest attacker-controlled or insufficiently trusted sitemap content are most exposed.

Exploit preconditions

  • Attack surface: Sitemap ingestion through LangChain Community's SitemapLoader
  • Required access: Ability to publish, modify, or cause the application to ingest a sitemap containing a nested sitemap reference
  • Trigger point: Processing of a nested sitemap element during sitemap parsing
  • Why exploitation is possible: The nested sitemap location reaches the asynchronous HTTP client without the configured same-domain restriction or private-network destination checks
  • Data condition: The requesting server must have network access to the targeted destination, and the response must be returned through the document-loading workflow

Why this happens

The vulnerability results from inconsistent application of URL trust policies across two parsing paths. Although direct leaf URLs are filtered against the configured domain, nested sitemap locations bypass that check and are sent to the HTTP fetcher as trusted destinations. This is a server-side request forgery condition mapped to CWE-918, where attacker-influenced URLs cause a server to make requests to internal or unintended network resources.

Potential impact

  • The server may access internal services that are not publicly reachable
  • Sensitive responses, metadata, or credentials may be disclosed to the caller
  • Cloud instance metadata or management endpoints could be queried
  • Network segmentation controls may be bypassed from the application's network position
  • Retrieved internal content could be incorporated into downstream documents or processing workflows

General mitigation guidance

Mitigation generally focuses on treating every externally influenced URL, including nested sitemap locations, as untrusted.

Common defensive patterns include:

  • Applying consistent domain and destination validation to all sitemap references
  • Blocking loopback, private, link-local, multicast, and other reserved address ranges
  • Resolving hostnames carefully and validating the resulting addresses before connecting
  • Restricting outbound traffic with network egress policies, proxies, and allowlists
  • Separating document-fetching workloads from sensitive internal networks
  • Returning only the minimum fetched content required by the application
  • Running fetchers with least-privilege network and identity permissions

How teams detect issues like this

Organizations can look for SSRF exposure through:

  • Static analysis of URL flows from sitemap, feed, or document inputs into HTTP client calls
  • Code review checks ensuring security controls cover recursive and alternate parsing branches
  • Tests using private, loopback, link-local, and redirected destinations
  • Runtime monitoring for outbound requests to internal address ranges and unexpected hostnames
  • Egress policy enforcement that denies unauthorized network destinations
  • Automated security review tools that flag attacker-controlled URLs passed to network libraries

Sources

SourceLink
github.comgithub.com/langchain-ai/langchain-community
github.comgithub.com/langchain-ai/langchain-community/blob/main/libs/community/langchain_community/document_loaders/sitemap.py
github.comgithub.com/langchain-ai/langchain/issues/38814
vulncheck.comvulncheck.com/advisories/langchain-community-sitemaploader-does-not-apply-restrict-to-same-domain-to-nested-sitemap-index-entries-allowing-server-side-request-forgery

Frequently asked

questions

Potentially. An attacker does not necessarily need direct network access to the server, but must be able to influence a sitemap that the vulnerable application ingests.

Authentication requirements depend on how sitemap content is supplied. The key prerequisite is the ability to control or influence an ingested sitemap or nested sitemap reference.

Apply the same destination validation to every URL-processing path, including nested sitemap entries, and combine it with private-network blocking and outbound egress restrictions.

Treat all fetched URLs as untrusted, test recursive parsing paths, enforce network-level allowlists, validate resolved IP addresses, and run document fetchers with minimal network and identity privileges.

Find out what's already
exploitable in your codebase.