GHSA-fv5p-p927-qmxr
MEDIUMGHSA-fv5p-p927-qmxr is a medium-severity (CVSS 6.5) vulnerability in langchain-text-splitters. O3 Security confirms whether GHSA-fv5p-p927-qmxr is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
LangChain Text Splitters: HTMLHeaderTextSplitter.split_text_from_url SSRF Redirect Bypass
Real-World Exposure
langchain-text-splittersReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | langchain-text-splitters | all versions | 1.1.2 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for langchain-text-splitters. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update langchain-text-splitters to 1.1.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-fv5p-p927-qmxr is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-fv5p-p927-qmxr is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-fv5p-p927-qmxr. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-fv5p-p927-qmxr in your dependencies?
O3 detects GHSA-fv5p-p927-qmxr across PyPI dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.