REDHAT-BUG-2401958: High severity pypi/langchain-text-splitters vulnerability

Published Oct 6, 2025
·
Updated

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.

Affected Software

2 affected components
pypi/langchain-text-splitters=0.3.8
pypi/lxml<=4.9.x, >=5.0

Event History

Oct 6, 2025
Data Sourced
via Red Hat·07:01 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of REDHAT-BUG-2401958?

The severity of REDHAT-BUG-2401958 is classified as high due to the potential for XML External Entity attacks.

2

How do I fix REDHAT-BUG-2401958?

To fix REDHAT-BUG-2401958, update langchain-text-splitters to a version that patches the XML parsing vulnerability.

3

Which versions of lxml are affected by REDHAT-BUG-2401958?

Versions of lxml from 4.9.x down to below 5.0 are affected by REDHAT-BUG-2401958.

4

What types of attacks can be executed using the vulnerability in REDHAT-BUG-2401958?

The vulnerability in REDHAT-BUG-2401958 can lead to XML External Entity (XXE) attacks, allowing attackers to access system files or perform server-side request forgery.

5

Is REDHAT-BUG-2401958 applicable to all lxml versions?

No, REDHAT-BUG-2401958 specifically affects lxml versions prior to 5.0, especially those in the 4.9.x range.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203