XXE Vulnerability in langchain-ai/langchain
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Partial Red Hat: 1 fixed, 2 without a fix
Attack profile from CVSS 3.0 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-611 and the CVSS impact.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| langchain-ai | langchain-ai/langchain | up to latest | — | No fix listed | CNA |
| — | langchain-text-splitters (PyPI) | before 0.3.9 | 0.3.9 | Patch available | GHSA-m42m-m8cr-8m58 |
- langchain-ai/langchain Vendorlangchain-ai Affected up to latest Fixed in — No fix listed CNA
- langchain-text-splitters (PyPI) Vendor— Affected before 0.3.9 Fixed in 0.3.9 Patch available GHSA-m42m-m8cr-8m58
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:langchain:langchain:*:*:*:*:*:*:*:* | — | — | langchain-ai |
- cpe:2.3:a:langchain:langchain:*:*:*:*:*:*:*:* Versions — — ·langchain-ai
Remediation
- Fix · GHSA-m42m-m8cr-8m58 langchain-text-splitters (PyPI) Fixed in 0.3.9 Advisory →
Red Hat 1 advisory
- RHSA-2025:18984 Released 2025-10-22 · Red Hat rating ImportantRed Hat Ansible Automation Platform 2.5 Container Release Update
- Red Hat Ansible Automation Platform 2.5 for RHEL 8 ansible-automation-platform-25/lightspeed-chatbot-rhel8, ansible-automation-platform-25/lightspeed-rhel8
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet |
| Red Hat Enterprise Linux AI (RHEL AI) | Affected | No fix planned: Will not fix |
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | Fixed | RHSA-2025:18984 |
Not affected: 4 products
- OpenShift Lightspeed
- Red Hat Ansible Automation Platform 2
- Red Hat Ansible Automation Platform 2.5 for RHEL 8
- Red Hat Ansible Automation Platform 2.5 for RHEL 9
Timeline
- 2026-10-02 Threatist record created from CVE-2025-6985
- 2026-10-03 Alias added: GHSA-m42m-m8cr-8m58
References
More langchain-ai vulnerabilities
- TI-2024-31340 langchain_experimental (aka LangChain Experimental) 0.1.17 through 0.3.0 for LangChain… CVSS 3.1CRITICAL 9.8
- TI-2023-20724 An issue in langchain langchain-ai v.0.0.232 and before allows a remote attacker to… CVSS 3.1CRITICAL 9.8
- TI-2023-20706 An issue in LanChain-ai Langchain v.0.0.245 allows a remote attacker to execute arbitrary… CVSS 3.1CRITICAL 9.8
- TI-2023-20166 An issue in Harrison Chase langchain v.0.0.194 and before allows a remote attacker to… CVSS 3.1CRITICAL 9.8
- TI-2023-20136 An issue in LangChain v.0.0.231 allows a remote attacker to execute arbitrary code via the prompt parameter. CVSS 3.1CRITICAL 9.8
- TI-2023-18185 An issue in langchain v.0.0.171 allows a remote attacker to execute arbitrary code via a… CVSS 3.1CRITICAL 9.8
Sources
- CVE-2025-6985 · CVE Program
- CVE-2025-6985 · NVD
- FIRST EPSS
- GHSA-m42m-m8cr-8m58 · GitHub Advisory Database · CC BY 4.0
- CVE-2025-6985 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences