Advisory

GHSA-vfmq-68hx-4jfw

Also known as: CVE-2026-41066, PYSEC-2026-87

Summary

lxml: Default configuration of iterparse() and ETCompatXMLParser() allows XXE to local files

Details

Impact
Using either of the two parsers in the default configuration (with resolve_entities=True) allows untrusted XML input to read local files.

Patches
lxml 6.1.0 changes the default to resolve_entities='internal', thus disallowing local file access by default.

Workarounds
Setting the resolve_entities option explicitly to resolve_entities='internal' or resolve_entities=False disables the local file access.

Resources
Original report: https://bugs.launchpad.net/lxml/+bug/2146291

The default option was changed to resolve_entities='internal' for the normal XML and HTML parsers in lxml 5.0. The default was not changed for iterparse() and ETCompatXMLParser() at the time. lxml 6.1 makes the safe option the default for all parsers.

Severity

High Basis: The source's own band: HIGH

Dates

Published
2026-04-21 20:38 UTC
Modified
2026-09-10 03:51 UTC

Affected packages and fixes

lxml

PyPI · All systems

Affected

  • introduced 0, fixed 6.1.0 (ecosystem)

Fixed versions

6.1.0

Fix

  • Fixed version 6.1.0
    pip install --upgrade lxml==6.1.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences