XML External Entity (XXE)Weakness · CWE-611

CVE-2025-6985

HIGH · 7.5 CVSS v3.0 Published 2025-10-06
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
84/100
Remediation priority · High
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

The HTMLSectionSplitter class in langchain-text-splitters 0.3.8 uses lxml.etree.parse() and lxml.etree.XSLT() to process XSLT stylesheets without security hardening. In lxml versions up to 4.9.x, external entities are resolved by default enabling file reads and HTTP fetches. In lxml 5.0+, the XSLT document() function can still access arbitrary URIs without XSLTAccessControl. Attackers can read any file the process has access to (SSH keys, env files, cloud metadata).

MitigationApply XSLTAccessControl to restrict XSLT document() function access, disable external entity resolution via lxml parser configuration, or upgrade to a patched version when available and validate/sanitize all XSLT input.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check if langchain-text-splitters is installed
    Run: pip show langchain-text-splitters or pip list | grep langchain-text-splitters to see the installed version
    Affected if The installed version is 0.3.8 specifically (verify exact version match to the affected version)
  2. Check lxml version
    Run: pip show lxml or pip list | grep lxml to see the installed lxml version
    Affected if lxml version is 4.9.x (external entities enabled by default) OR lxml version is 5.0+ without XSLTAccessControl configured in the code
  3. Identify use of HTMLSectionSplitter in codebase
    Search for imports: from langchain_text_splitters import HTMLSectionSplitter or usages of HTMLSectionSplitter in your Python code
    Affected if HTMLSectionSplitter class from langchain-text-splitters is imported and used in the application
  4. Verify XSLT processing without security hardening
    Search code for lxml.etree.parse() and lxml.etree.XSLT() calls that process XSLT stylesheets, check if XSLTAccessControl or safe_parser configuration is applied
    Affected if XSLT stylesheets are parsed using lxml without XSLTAccessControl restrictions or without disabling external entity resolution

You are affected if you use langchain-text-splitters version 0.3.8 with lxml and your code processes XSLT stylesheets via HTMLSectionSplitter without security hardening measures in place.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Apply XSLTAccessControl to restrict XSLT document() function access, disable external entity resolution via lxml parser configuration, or upgrade to a patched version when available and validate/sanitize all XSLT input.

Recommended fix Moderate confidence

langchain-text-splitters version > 0.3.8 (check PyPI for latest release)

  1. 1. Upgrade langchain-text-splitters to the latest available version that includes the security fix for this XXE vulnerability.
  2. 2. Verify the upgrade by checking the installed package version: pip show langchain-text-splitters
  3. 3. Ensure lxml is also updated to the latest version to benefit from security hardening in the library.
  4. 4. If upgrade is not immediately possible, review code using HTMLSectionSplitter and ensure no untrusted XSLT stylesheets are passed to it.
  5. 5. Consider implementing XSLTAccessControl if custom XSLT processing is required as a mitigation.
Caveat Verify compatibility with your LangChain version as text-splitter API changes may affect existing code

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation3.0 h
  • Implementation6.0 h
  • Testing3.0 h
  • Review / QA2.0 h
14.0 hours of engineering $2,490
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,984.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2025-6985 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2025-6985 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data