Vulnerabilities in pkg:pypi/langchain-text-splitters
PACKAGECVE-2026-41481 is a MODERATE (CVSS 6.5) htmlheadertextsplitter.split_text_from_url ssrf redirect bypass vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting LangChain Text Splitters libraries in the PyPI ecosystem. The issue involves htmlheadertextsplitter.split_text_from_url ssrf redirect bypass. Remediation is available by upgrading affected packages to version 1.1.2.
pkg:pypi/langchain-text-splitters
Vulnerability advisories affecting package pkg:pypi/langchain-text-splitters. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-fv5p-p927-qmxr | CVE-2026-41481 | MODERATE | LangChain Text Splitters: HTMLHeaderTextSplitter.split_text_from_url SSRF Redirect Bypass |
| GHSA-m42m-m8cr-8m58 | CVE-2025-6985 | HIGH | LangChain Text Splitters is vulnerable to XML External Entity (XXE) attacks due to unsafe XSLT parsing |
CVE-2026-41481 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N).
How to Fix CVE-2026-41481
To remediate this vulnerability, upgrade all affected LangChain Text Splitters dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install langchain-text-splitters>=1.1.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show langchain-text-splitters
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-41481, inspect your installed packages using pip:
pip show langchain-text-splitters
Analyze the terminal output to locate any version of LangChain Text Splitters in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.2), your application is affected.
Note: The pip show langchain-text-splitters command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In LangChain Text Splitters, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-41481 Affected LangChain Text Splitters Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
langchain-text-splitters
|
PyPI |
< 1.1.2
|
1.1.2
|
References
Frequently Asked Questions
What is CVE-2026-41481?
Which LangChain Text Splitters versions are affected?
What version fixes CVE-2026-41481?
Is langchain-text-splitters affected?
What is the CVSS score of CVE-2026-41481?
What CWE is associated with CVE-2026-41481?
How can I check PyPI dependencies for CVE-2026-41481?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fv5p-p927-qmxr",
"modified" : "2026-06-06T00:58:49Z",
"published" : "2026-04-16T22:53:32Z",
"aliases" : [ "CVE-2026-41481" ],
"summary" : "LangChain Text Splitters: HTMLHeaderTextSplitter.split_text_from_url SSRF Redirect Bypass",
"details" : "## Summary\n\n`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.\n\nThe 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.\n\n## Affected versions\n\n- `langchain-text-splitters` < 1.1.2\n\n## Patched versions\n\n- `langchain-text-splitters` >= 1.1.2 (requires `langchain-core` >= 1.2.31)\n\n## Affected code\n\n**File:** `libs/text-splitters/langchain_text_splitters/html.py` — `split_text_from_url()`\n\nThe vulnerable pattern validated the URL once then fetched with redirects enabled:\n\n```python\nvalidate_safe_url(url, allow_private=False, allow_http=True)\nresponse = requests.get(url, timeout=timeout, **kwargs)\n```\n\n## Attack scenario\n\n1. A developer passes external URLs to `split_text_from_url()`, relying on its\n built-in `validate_safe_url()` check to block requests to internal networks.\n2. An attacker supplies a URL pointing to a public host they control. The URL\n passes `validate_safe_url()` (public hostname, public IP).\n3. The attacker's server responds with a `302` redirect to an internal endpoint\n (e.g., an unauthenticated internal admin API, or a cloud instance metadata\n service that does not require request headers — such as AWS IMDSv1).\n4. `requests.get()` follows the redirect automatically. The redirect target is\n **not** revalidated.\n5. The response body is parsed and returned as `Document` objects to the\n application.\n\n**Notes:**\n\n- The core issue is a bypass of an explicitly provided SSRF protection.\n `split_text_from_url()` included `validate_safe_url()` specifically to be\n safe with untrusted URLs — the redirect loophole defeated that guarantee.\n- Cloud metadata endpoints that require special headers (AWS IMDSv2, GCP, Azure)\n are not reachable through this bug because the attacker does not control\n request headers. AWS IMDSv1, which requires no headers, is reachable.\n- Data exfiltration requires the application to return Document contents to the\n party that supplied the URL. The SSRF itself — forcing the server to issue a\n request to an internal endpoint — does not require this.\n\n## Fix\n\nThe 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.\n\nAdditionally, `split_text_from_url()` has been deprecated. Users should fetch HTML content themselves and pass it to `split_text()` directly.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "langchain-text-splitters"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/langchain-ai/langchain/security/advisories/GHSA-fv5p-p927-qmxr"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41481"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/langchain-ai/langchain"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/langchain-text-splitters/PYSEC-2026-77.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-918" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-16T22:53:32Z",
"nvd_published_at" : "2026-04-24T21:16:19Z"
}
}