INCIDENT MAP

Browse / AI Framework and Platform Flaws / CVE-2026-41481

LangChain Text Splitters: HTMLHeaderTextSplitter.split_text_from_url SSRF Redirect Bypass

CVE-2026-41481 · 2026-04-16 moderate

Class
AI Framework and Platform Flaws (filed by a model that read the advisory)
Technique
Server-side request forgery
Affected
langchain-text-splitters (PyPI)
Gets past
SSRF protection
CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
EPSS
0.3% chance of exploitation in 30 days

How it works, in short

URL validation runs only on the first request, and redirects are then followed without revalidation, so an attacker can reach internal or metadata endpoints. (Our summary, written by a model. The source text is below.)

Details

Summary

HTMLHeaderTextSplitter.split_text_from_url() validated the initial URL using validate_safe_url() but then performed the fetch with requests.get() with redirects enabled (the default). Because redirect targets were not revalidated, a URL pointing to an attacker-controlled server could redirect to internal, localhost, or cloud metadata endpoints, bypassing SSRF protections.

The response body is parsed and returned as Document objects to the calling application code. Whether this constitutes a data exfiltration path depends on the application: if it exposes Document contents (or derivatives) back to the requester who supplied the URL, sensitive data from internal endpoints could be leaked. Applications that store or process Documents internally without returning raw content to the requester are not directly exposed to data exfiltration through this issue.

Affected versions

Patched versions

Affected code

File: libs/text-splitters/langchain_text_splitters/html.py — split_text_from_url()

The vulnerable pattern validated the URL once then fetched with redirects enabled:

validate_safe_url(url, allow_private=False, allow_http=True)
response = requests.get(url, timeout=timeout, **kwargs)

Attack scenario

Notes:

Fix

The fix replaces requests.get() with an SSRF-safe httpx transport (SSRFSafeSyncTransport from langchain-core) that validates DNS results and pins connections to validated IPs on every request, including redirect targets, eliminating redirect-based bypasses.

Additionally, split_text_from_url() has been deprecated. Users should fetch HTML content themselves and pass it to split_text() directly.

References

Source: GitHub Advisory Database, used under CC BY 4.0.