PYSEC-2026-1520

See a problem?
Import Source
https://github.com/pypa/advisory-database/blob/main/vulns/langchain-text-splitters/PYSEC-2026-1520.yaml
JSON Data
https://api.osv.dev/v1/vulns/PYSEC-2026-1520
Aliases
Published
2026-07-07T16:03:06.553792Z
Modified
2026-07-07T17:46:47.935773348Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N CVSS Calculator
Summary
LangChain Text Splitters is vulnerable to XML External Entity (XXE) attacks due to unsafe XSLT parsing
Details

The HTMLSectionSplitter class in langchain-text-splitters 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.

References

Affected packages

PyPI / langchain-text-splitters

Package

Name
langchain-text-splitters
View open source insights on deps.dev
Purl
pkg:pypi/langchain-text-splitters

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.3.9

Affected versions

0.*
0.0.1
0.0.2
0.2.0
0.2.1
0.2.2
0.2.4
0.3.0.dev0
0.3.0.dev1
0.3.0
0.3.1
0.3.2
0.3.3
0.3.4
0.3.5
0.3.6rc1
0.3.6rc2
0.3.6
0.3.7
0.3.8

Database specific

source
"https://github.com/pypa/advisory-database/blob/main/vulns/langchain-text-splitters/PYSEC-2026-1520.yaml"