CVE-2025-6985 json
XXE Vulnerability in langchain-ai/langchain
published 2025-10-06 13 mo ago modified 2026-10-19 20 d ago also GHSA-m42m-m8cr-8m58 , PYSEC-2026-1520 , EUVD-2025-31884
- cvss
- 7.5
- version 3.0, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.5%
- EPSS 0.5% chance of exploitation in 30 days, percentile 43%
- public exploits
- 0
- none known
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.
Patch / fix
- pypi langchain-text-splitters 0.3.9
- github.com/langchain-ai/langchain@43eef43 commit
- github.com/langchain-ai/langchain#31819 pull request
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2025-6985 updated cvss 7.5
langchain-text-splitters: XXE Vulnerability in langchain-text-splitters
-
Red Hat Ansible Automation Platform 2 ansible-automation-platform-24/lightspeed-rhel8, ansible-automation-platform-26/lightspeed-rhel9affected: workaround, no fix available, no fix planned “Will not fix”
-
Red Hat Enterprise Linux AI (RHEL AI) rhelai1/bootc-amd-rhel9, rhelai1/bootc-intel-rhel9, rhelai1/bootc-nvidia-rhel9, rhelai1/bootc-azure-amd-rhel9, rhelai1/instructlab-amd-rhel9, rhelai1/bootc-aws-nvidia-rhel9, +4 moreaffected: workaround, no fix planned “Will not fix”
-
Red Hat Ansible Automation Platform 2.5 for RHEL 8 ansible-automation-platform-25/lightspeed-rhel8 2.5.250924-2fixed: vendor fix RHSA-2025:18984
-
Red Hat OpenShift Lightspeed openshift-lightspeed/lightspeed-service-api-rhel9 Red Hat Ansible Automation Platform 2 ansible-automation-platform/ee-minimal-rhel8, ansible-automation-platform/ee-minimal-rhel9, ansible-automation-platform-24/de-minimal-rhel8, ansible-automation-platform-24/de-minimal-rhel9, ansible-automation-platform-24/ee-minimal-rhel8, ansible-automation-platform-24/ee-minimal-rhel9, +25 more Red Hat Ansible Automation Platform 2.5 for RHEL 8 ansible-automation-platform-25/hub-rhel8 4.10.9-1, ansible-automation-platform-25/hub-web-rhel8 4.10.9-1, ansible-automation-platform-25/receptor-rhel8 1.6.0-1, ansible-automation-platform-25/de-minimal-rhel8 1.1.7-14, ansible-automation-platform-25/controller-rhel8 4.6.21-13, ansible-automation-platform-25/ee-minimal-rhel8 1.0.0-982, +26 more Red Hat Ansible Automation Platform 2.5 for RHEL 9 ansible-automation-platform-25/de-minimal-rhel9 1.1.7-15, ansible-automation-platform-25/ee-minimal-rhel9 1.0.0-983, ansible-automation-platform-25/de-supported-rhel9 1.1.7-13, ansible-automation-platform-25/ee-supported-rhel9 1.0.0-1108, ansible-automation-platform-25/ansible-builder-rhel9 3.1.0-260, ansible-automation-platform-25/ee-cloud-services-rhel9 1.0.0-316, +2 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- yes
- Technical impact
- partial
- Assessed
- 13 mo ago
Exploit prediction
0.51% chance of exploitation in the next 30 days, higher than 43% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.0 | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| GitHub | 3.0 | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| OSV | 3.0 | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | langchain-text-splitters | <0.3.9 |
0.3.9 |
Affected products
- langchain-ai langchain-ai/langchain
Classification
- Weakness
-
- CWE-611 Improper Restriction of XML External Entity Reference
References
-
github.com
/langchain-ai/langchain/pull/31819
web
-
github.com
/langchain-ai/langchain/commit/43eef435505a1c907227b724c0c760ad5fc01790
web
-
huntr.com
/bounties/cf78abbb-df3b-43de-b6ee-132b73ff8331
web
-
nvd.nist.gov
/vuln/detail/CVE-2025-6985
advisory
-
github.com
/langchain-ai/langchain
package
-
pypi.org
/project/langchain-text-splitters
package
-
github.com
/advisories/GHSA-m42m-m8cr-8m58
advisory
Sources
- CVE List CVE-2025-6985
- GitHub Advisory GHSA-m42m-m8cr-8m58
- NVD CVE-2025-6985
- OSV PYSEC-2026-1520
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.