---
id: CVE-2026-41066
aliases:
  - GHSA-vfmq-68hx-4jfw
  - PYSEC-2026-87
title: >-
  lxml: Default configuration of iterparse() and ETCompatXMLParser() allows XXE
  to local files
summary: >-
  lxml: Default configuration of iterparse() and ETCompatXMLParser() allows XXE
  to local files
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'
vendor: lxml
product: lxml
ecosystem: pip
affected:
  - lxml < 6.1.0
patched:
  - lxml 6.1.0
published: '2026-04-21'
updated: '2026-09-10'
sourceUpdated: '2026-09-10T03:51:03.302383702Z'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-vfmq-68hx-4jfw'
references:
  - url: 'https://github.com/lxml/lxml/security/advisories/GHSA-vfmq-68hx-4jfw'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-41066'
  - url: 'https://bugs.launchpad.net/lxml/+bug/2146291'
  - url: 'https://github.com/lxml/lxml'
  - url: 'https://github.com/lxml/lxml/releases/tag/lxml-6.1.0'
  - url: >-
      https://github.com/pypa/advisory-database/tree/main/vulns/lxml/PYSEC-2026-87.yaml
tags:
  - osv
  - pip
epss: 0.00409
epssPercentile: 0.32446
ingestedAt: '2026-09-12T03:13:01.730Z'
---

## Overview

### 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.

## Affected packages

- `lxml < 6.1.0`

## Remediation

Upgrade to a patched release:

- `lxml 6.1.0`
