Skip to main content

LangChain Text Splitters CVE-2025-6985

HIGH
Improper Restriction of XML External Entity Reference (CWE-611)
2025-10-06 security@huntr.dev
7.5
CVSS 3.0 · Vendor: huntr
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted XSLT stylesheet to app
  2. Delivery
    HTMLSectionSplitter parses it via lxml
  3. Exploit
    External entity/document() resolves URI
  4. Execution
    Read local file or SSRF fetch
  5. Impact
    Exfiltrate sensitive file contents

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A02:2025 - Security Misconfiguration
ASVS 5.0
V13 - Configuration XML external entity prevention
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the hosting application to use the HTMLSectionSplitter class in langchain-text-splitters 0.3.8 AND to permit attacker-influenced custom XSLT stylesheets, which are processed by lxml.etree.parse()/lxml.etree.XSLT() without XSLTAccessControl hardening. Severity of the primitive depends on the lxml version: lxml up to 4.9.x resolves external entities by default (full XXE file read and outbound HTTP(S) fetch), while lxml 5.0+ disables entity expansion but still allows the XSLT document() function to read arbitrary URIs unless XSLTAccessControl is applied. The key limiting factor is deployment design: if the application never exposes custom/user-supplied XSLT to the splitter, the vulnerable path is not reachable. No authentication, special privileges, or user interaction are required once that path is exposed.

Impact

Signals are mostly aligned toward moderate, conditional risk rather than urgent priority. The CVSS 3.0 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N, 7.5 High) describes a network-reachable, unauthenticated, low-complexity information-disclosure flaw with high confidentiality impact but no integrity or availability impact - consistent with an XXE file-read primitive. However, that score assumes the attacker can reach the vulnerable code path, which the description itself qualifies: exploitation applies to 'default deployments that enable custom XSLT,' meaning the hosting application must expose arbitrary attacker-controlled XSLT stylesheets to HTMLSectionSplitter. This is an important caveat the raw CVSS does not capture. The EPSS score is low (0.51%, 42nd percentile), the CVE is NOT in CISA KEV, and no exploit is explicitly flagged in the input, so there is no evidence of active or widespread exploitation. The single reference is a huntr.dev bug-bounty submission, which typically includes reproduction detail, but POC status is not confirmed in the provided data. Net: a genuine, verifiable confidentiality weakness in a popular library, but real-world risk is gated by whether a given application passes untrusted XSLT into the splitter - more a latent integration risk than a broadly wormable issue. Note also the CVSS 3.0 impact of C:H with I:N/A:N accurately reflects read-only file/SSRF access rather than code execution.

Exploit ScenarioDerived

An application that uses langchain-text-splitters 0.3.8 and lets users supply or influence a custom XSLT stylesheet for HTMLSectionSplitter accepts an attacker-crafted stylesheet containing an external entity or a document() reference. When lxml.etree.parse()/XSLT() processes it without XSLTAccessControl hardening, the parser resolves the external URI, returning the contents of a local file (e.g. ~/.ssh/id_rsa, .env) or performing an outbound fetch to cloud metadata endpoints. No authentication or user interaction is required; the data is reflected back or exfiltrated to an attacker-controlled host. A huntr.dev bounty report exists, but a public weaponized exploit is not confirmed in the provided data.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 19, 2026

XML External Entity (XXE) in LangChain Text Splitters 0.3.8 allows unauthenticated remote attackers to read arbitrary files or make outbound HTTP(S) requests when an application uses HTMLSectionSplitter with attacker-influenced XSLT stylesheets. The vulnerable path is only reachable if the hosting application permits custom XSLT and processes it via lxml.etree.parse()/lxml.etree.XSLT() without XSLTAccessControl; lxml up to 4.9.x resolves external entities by default, while lxml 5.0+ still permits URI reads through the XSLT document() function. EPSS is 0.51% (42nd percentile) and no public exploit code or CISA KEV entry was identified at time of analysis.

RemediationAI

No vendor-released patch was identified in the provided data. Until a fixed langchain-text-splitters release is available, do not pass attacker-influenced or user-supplied XSLT stylesheets into HTMLSectionSplitter; restrict the splitter to fixed, trusted stylesheets and treat custom XSLT as code. If dynamic XSLT is required, patch or fork HTMLSectionSplitter to construct lxml parsers with resolve_entities=False, load_dtd=False, and no_network=True and to pass XSLTAccessControl with file, directory, and network access disabled to lxml.etree.XSLT(); the trade-off is that legitimate stylesheets relying on document() or external resources will fail, and the forked code must be maintained. Upgrading lxml to 5.0 or later is useful defense-in-depth but does not by itself close the document() URI-read path because the splitter still must apply XSLTAccessControl. Monitor the huntr report at https://huntr.com/bounties/cf78abbb-df3b-43de-b6ee-132b73ff8331 for remediation updates.

Affected Packages

pypi langchain-text-splitters fix: 0.3.9

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

HTMLSectionSplitter in langchain-text-splitters 0.3.8 builds splitting behavior from XSLT stylesheets and invokes lxml.etree.parse() and lxml.etree.XSLT() directly. The root cause is CWE-611: the parser and XSLT processor are not hardened with XSLTAccessControl, so external entity resolution or the XSLT document() function can dereference attacker-controlled URIs. In lxml up to 4.9.x, external entities are resolved by default, enabling local file disclosure and outbound HTTP(S) fetches; in lxml 5.0 and above, entity expansion is disabled but document() can still read any URI the process can access unless access control is applied. The class therefore exposes read-only access to files such as SSH keys, environment files, source code, or cloud metadata, but only when the application allows untrusted custom XSLT to reach the splitter.

Know when Langchain gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (huntr) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
vuln.today AI 7.5 HIGH

Network-reachable unauthenticated XXE file read with no UI; read-only disclosure gives C:H and I:N/A:N; scope unchanged as the vulnerable process reads files directly.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Red Hat 7.5 HIGH

Primary rating from Vendor (huntr).

CVSS VectorVendor: huntr

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

DescriptionCVE.org

The HTMLSectionSplitter class in langchain-text-splitters version 0.3.8 is vulnerable to XML External Entity (XXE) attacks due to unsafe XSLT parsing. This vulnerability arises because the class allows the use of arbitrary XSLT stylesheets, which are parsed using lxml.etree.parse() and lxml.etree.XSLT() without any hardening measures. In lxml versions up to 4.9.x, external entities are resolved by default, allowing attackers to read arbitrary local files or perform outbound HTTP(S) fetches. In lxml versions 5.0 and above, while entity expansion is disabled, the XSLT document() function can still read any URI unless XSLTAccessControl is applied. This vulnerability allows remote attackers to gain read-only access to any file the LangChain process can reach, including sensitive files such as SSH keys, environment files, source code, or cloud metadata. No authentication, special privileges, or user interaction are required, and the issue is exploitable in default deployments that enable custom XSLT.

Executive ViewAI

Why It Matters

LangChain Text Splitters 0.3.8 can expose sensitive local files or initiate outbound network requests in applications that allow attacker-influenced XSLT stylesheets in the HTMLSectionSplitter component. Leadership should care because affected document-processing or ingestion services could leak data or be abused to reach restricted internal resources; ownership sits with teams running LangChain-based pipelines.

Business Impact: High
Compensating Controls

No vendor-released patch identified; disable custom or attacker-controlled XSLT in HTMLSectionSplitter, enforce lxml XSLTAccessControl denying file and network access, block document() external URI retrieval, restrict outbound egress, run with least privilege, and monitor for anomalous file reads or outbound requests.

Threat Intelligence Overview

EPSS Score
0.5%
Top 58% exploitable
Prevalence
Medium
popular LLM library, but vulnerable custom-XSLT path is niche
Data Quality
3 sources
Confidence: Low

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

XML External Entity (XXE) attacks exploit XML parsers that process Document Type Definitions (DTDs) without proper restrictions.

CVE-2026-27966 CRITICAL POC
9.8 Feb 26

Code injection in Langflow CSV Agent node before 1.8.0. The node hardcodes allow_dangerous_code=True, enabling arbitrary

CVE-2023-36095 CRITICAL POC
9.8 Aug 05

An issue in Harrison Chase langchain v.0.0.194 allows an attacker to execute arbitrary code via the python exec calls in

CVE-2025-2828 CRITICAL POC
10.0 Jun 23

A remote code execution vulnerability in langchain-ai/langchain (CVSS 10.0). Risk factors: public PoC available. Vendor

CVE-2024-8309 CRITICAL POC
9.8 Oct 29

A vulnerability in the GraphCypherQAChain class of langchain-ai/langchain version 0.2.5 allows for SQL injection through

CVE-2024-7042 CRITICAL POC
9.8 Oct 29

A vulnerability in the GraphCypherQAChain class of langchain-ai/langchainjs versions 0.2.5 and all versions with this cl

CVE-2024-46946 CRITICAL POC
9.8 Sep 19

langchain_experimental (aka LangChain Experimental) 0.1.17 through 0.3.0 for LangChain allows attackers to execute arbit

CVE-2024-2057 CRITICAL POC
9.8 Mar 01

A vulnerability was found in LangChain langchain_community 0.0.26. Rated critical severity (CVSS 9.8), this vulnerabilit

CVE-2023-39631 CRITICAL POC
9.8 Sep 01

An issue in LanChain-ai Langchain v.0.0.245 allows a remote attacker to execute arbitrary code via the evaluate function

CVE-2023-36281 CRITICAL POC
9.8 Aug 22

An issue in langchain v.0.0.171 allows a remote attacker to execute arbitrary code via a JSON file to load_prompt. Rated

CVE-2023-39659 CRITICAL POC
9.8 Aug 15

An issue in langchain langchain-ai v.0.0.232 and before allows a remote attacker to execute arbitrary code via a crafted

CVE-2023-38896 CRITICAL POC
9.8 Aug 15

An issue in Harrison Chase langchain v.0.0.194 and before allows a remote attacker to execute arbitrary code via the fro

CVE-2023-38860 CRITICAL POC
9.8 Aug 15

An issue in LangChain v.0.0.231 allows a remote attacker to execute arbitrary code via the prompt parameter. Rated criti

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy