CVE-2025-6985
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 · uneditedThe 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 confidenceThe 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).
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 checksWork through these to decide whether this CVE applies to you.
-
Check if langchain-text-splitters is installedRun: pip show langchain-text-splitters or pip list | grep langchain-text-splitters to see the installed versionAffected if The installed version is 0.3.8 specifically (verify exact version match to the affected version)
-
Check lxml versionRun: pip show lxml or pip list | grep lxml to see the installed lxml versionAffected if lxml version is 4.9.x (external entities enabled by default) OR lxml version is 5.0+ without XSLTAccessControl configured in the code
-
Identify use of HTMLSectionSplitter in codebaseSearch for imports: from langchain_text_splitters import HTMLSectionSplitter or usages of HTMLSectionSplitter in your Python codeAffected if HTMLSectionSplitter class from langchain-text-splitters is imported and used in the application
-
Verify XSLT processing without security hardeningSearch code for lxml.etree.parse() and lxml.etree.XSLT() calls that process XSLT stylesheets, check if XSLTAccessControl or safe_parser configuration is appliedAffected 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.
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 · scopedApply 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.
langchain-text-splitters version > 0.3.8 (check PyPI for latest release)
- 1. Upgrade langchain-text-splitters to the latest available version that includes the security fix for this XXE vulnerability.
- 2. Verify the upgrade by checking the installed package version: pip show langchain-text-splitters
- 3. Ensure lxml is also updated to the latest version to benefit from security hardening in the library.
- 4. If upgrade is not immediately possible, review code using HTMLSectionSplitter and ensure no untrusted XSLT stylesheets are passed to it.
- 5. Consider implementing XSLTAccessControl if custom XSLT processing is required as a mitigation.
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation3.0 h
- Implementation6.0 h
- Testing3.0 h
- Review / QA2.0 h
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 locallyCheck 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2025-6985 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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