CVE-2026-41066: lxml XXE in iterparse and ETCompatXMLParser

CVE-2026-41066 · Severity: high · CVSS 7.5 · Published 2026-04-24

A vulnerability in the lxml Python library, which is widely used for processing XML and HTML data, could allow an attacker to read sensitive files from the local server. By providing a specially crafted XML file to an application using certain lxml functions, an attacker can trick the system into disclosing local data. This could lead to the exposure of configuration files, credentials, or other private information stored on the host machine.

Technologies: lxml (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-41066 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-41066 being exploited in the wild.
How severe is CVE-2026-41066?
High severity, with a CVSS score of 7.5, published 24 April 2026.
Which products and versions are affected?
lxml (PyPI) < 6.1.0, ECOSYSTEM:introduced=0,fixed=6.1.0.
Is there a fix for CVE-2026-41066?
Yes. lxml (PyPI): upgrade to 6.1.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-41066 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-41066?
Check whether you run Lxml or lxml (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • lxml (PyPI): upgrade to 6.1.0 or later
    pip install "lxml>=6.1.0"

Technical details

A XML External Entity (XXE) vulnerability (CWE-611) exists in lxml's iterparse() and ETCompatXMLParser() components. The root cause is a default configuration where 'resolve_entities' is set to True, allowing the parser to resolve external entities in untrusted XML input. A remote, unauthenticated attacker can exploit this by submitting a malicious XML document that references local file URIs, which the parser will then resolve and potentially expose in its output. This was addressed in version 6.1.0 by changing the default behavior to 'internal' entity resolution only.

Affected products

  • lxml lxml < 6.1.0

Identifiers

  • CVE-2026-41066
  • GHSA-vfmq-68hx-4jfw
  • PYSEC-2026-87

Timeline

  • 2026-04-18: disclosed: Original report on Launchpad
  • 2026-04-21: advisory: GitHub Advisory published
  • 2026-04-24: other: NVD publication date

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.