PYSEC-2026-87: lxml: Default configuration of iterparse() and ETCompatXMLParser() allows XXE to local files

Published Apr 24, 2026
·
Updated

lxml is a library for processing XML and HTML in the Python language. Prior to 6.1.0, using either of the two parsers in the default configuration (with resolveentities=True) allows untrusted XML input to read local files. Setting the resolveentities option explicitly to resolveentities='internal' or resolveentities=False disables the local file access. This vulnerability is fixed in 6.1.0.

Affected Software

1 affected component
pypi/lxml<6.1.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade lxml to a version that resolves this vulnerability.

    Fixed in 6.1.0
  2. Configuration

    Set resolve_entities explicitly to 'internal' or False to disable local file access.

    lxml resolve_entities = 'internal' or False

Event History

Apr 24, 2026
CVE Published
via OSV·04:45 PM
Data Sourced
via OSV·04:45 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed?

Deployments using lxml versions before 6.1.0 are exposed when they parse untrusted XML with iterparse() or ETCompatXMLParser() in their default configuration, where resolve_entities=True.

2

What does an attacker need to exploit this issue?

An attacker needs to supply XML content that is processed by one of the affected parsers. No authentication or user interaction is required according to the supplied severity vector.

3

What is the impact of successful exploitation?

The issue allows untrusted XML to read local files through external entity expansion. The provided severity vector indicates high confidentiality impact, with no integrity or availability impact.

4

What can be done if upgrading is not immediately possible?

Explicitly configure the parser with resolve_entities='internal' or resolve_entities=False. Either setting disables local file access.

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