6.5medium
LangChain: HTMLHeaderTextSplitter.split_text_from_url SSRF Redirect Bypass
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.27% (higher than 20% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-fv5p-p927-qmxrPYSEC-2026-77
Description
LangChain is a framework for building agents and LLM-powered applications. Prior to langchain-text-splitters 1.1.2, 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. This vulnerability is fixed in 1.1.2.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| langchain-ai langchain-text-splitters | < 1.1.2 | CVE List |
| mta/mta-solution-server-rhel9 | Not specified | CVE List |
| openshift-lightspeed/lightspeed-service-api-rhel9 | Not specified | CVE List |
| ansible-automation-platform-24/lightspeed-rhel8 | Not specified | CVE List |
| ansible-automation-platform-25/lightspeed-chatbot-rhel8 | Not specified | CVE List |
| ansible-automation-platform-25/lightspeed-rhel8 | Not specified | CVE List |
| rhoai/odh-llama-stack-core-rhel9 | Not specified | CVE List |
| rhoai/odh-trustyai-nemo-guardrails-server-rhel9 | Not specified | CVE List |
| langchain-text-splitters (PyPI) | before 1.1.2 | GitHub Advisory Database, PyPA Advisory Database |
| langchain langchain-text-splitters | before 1.1.2 | NVD |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N |
| redhat-SADP | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N |
| PyPA Advisory Database | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
LangChain is a framework for building agents and LLM-powered applications. Prior to langchain-text-splitters 1.1.2, 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. This vulnerability is fixed in 1.1.2.
GitHub Advisory Database
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
langchain-text-splitters< 1.1.2
Patched versions
langchain-text-splitters>= 1.1.2 (requireslangchain-core>= 1.2.31)
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
- A developer passes external URLs to
split_text_from_url(), relying on its built-invalidate_safe_url()check to block requests to internal networks. - An attacker supplies a URL pointing to a public host they control. The URL
passes
validate_safe_url()(public hostname, public IP). - The attacker's server responds with a
302redirect to an internal endpoint (e.g., an unauthenticated internal admin API, or a cloud instance metadata service that does not require request headers — such as AWS IMDSv1). requests.get()follows the redirect automatically. The redirect target is not revalidated.- The response body is parsed and returned as
Documentobjects to the application.
Notes:
- The core issue is a bypass of an explicitly provided SSRF protection.
split_text_from_url()includedvalidate_safe_url()specifically to be safe with untrusted URLs — the redirect loophole defeated that guarantee. - Cloud metadata endpoints that require special headers (AWS IMDSv2, GCP, Azure) are not reachable through this bug because the attacker does not control request headers. AWS IMDSv1, which requires no headers, is reachable.
- Data exfiltration requires the application to return Document contents to the party that supplied the URL. The SSRF itself — forcing the server to issue a request to an internal endpoint — does not require this.
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.
NVD (es)
LangChain es un framework para construir agentes y aplicaciones impulsadas por LLM. Antes de langchain-text-splitters 1.1.2, HTMLHeaderTextSplitter.split_text_from_url() validaba la URL inicial usando validate_safe_url() pero luego realizaba la obtención con requests.get() con redirecciones habilitadas (el valor predeterminado). Debido a que los destinos de redirección no se revalidaban, una URL que apuntaba a un servidor controlado por un atacante podría redirigir a puntos finales internos, de localhost o de metadatos en la nube, eludiendo las protecciones de SSRF. El cuerpo de la respuesta se analiza y se devuelve como objetos Document al código de la aplicación que realiza la llamada. Si esto constituye una ruta de exfiltración de datos depende de la aplicación: si expone el contenido de Document (o sus derivados) de vuelta al solicitante que proporcionó la URL, los datos sensibles de los puntos finales internos podrían filtrarse. Las aplicaciones que almacenan o procesan Documentos internamente sin devolver contenido sin procesar al solicitante no están directamente expuestas a la exfiltración de datos a través de este problema. Esta vulnerabilidad se corrige en la versión 1.1.2.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-41481 changed 2026-07-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-fv5p-p927-qmxr changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-41481 changed 2026-10-26 | Public domain |
| PyPA Advisory Database | PYSEC-2026-77 changed 2026-05-20 | CC-BY-4.0 |