CVE-2026-41066: lxml Default Configuration Allows XXE to Local Files

lxml Updated 21 Apr 2026

Summary

21/04/2026
Yes i
High
7.5

CVE-2026-41066: lxml: Default configuration of iterparse() and ETCompatXMLParser() allows XXE to local files. Affects lxml versions < 6.1.0. Fixed in 6.1.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

lxml is a powerful and feature-rich library in Python for processing XML and HTML documents. It provides a simple and efficient API for parsing and creating XML and HTML, making it a popular choice among developers. However, certain configurations of lxml can expose applications to security vulnerabilities, particularly when handling untrusted XML input.

Vulnerability Detail

The vulnerability arises from the default configuration of the iterparse() and ETCompatXMLParser() functions in lxml, which allows the option resolve_entities to be set to True. This configuration can lead to XML External Entity (XXE) attacks, enabling attackers to read local files on the server. If untrusted XML input is processed, it can potentially expose sensitive information stored in local files, leading to severe security implications.

How To Fix

Latest published version: 6.1.3 as of 22 Oct 2026

pip install --upgrade "lxml==6.1.3"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

6.1.0

This is the first release that contains the fix.

pip install --upgrade "lxml==6.1.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If you cannot update to the patched version, you can disable local file access by explicitly setting the resolve_entities option in your code as follows:

import lxml.etree as ET

parser = ET.XMLParser(resolve_entities='internal')

Alternatively, you can set it to False:

parser = ET.XMLParser(resolve_entities=False)

Conclusion

The vulnerability CVE-2026-41066 in the lxml package poses a significant risk due to its default configuration allowing XXE attacks. It is crucial to update to the latest version or implement workarounds to secure your applications against potential file access vulnerabilities.

See every vulnerability recorded for lxml →

Share this vulnerability

FAQ

XXE stands for XML External Entity, a type of attack that exploits the ability of XML parsers to include external entities, potentially leading to unauthorized file access.

You can use Vulert to monitor and alert in real-time for open-source vulnerabilities in your software. Check your application against the vulnerability using the Vulert playground without any signup.

The CVSS score for this vulnerability is 7.5, indicating a high severity level.

If you cannot update to the patched version, make sure to set the resolve_entities option to 'internal' or False in your XML parsing code to mitigate the risk.

You can find more information in the original report on Launchpad or by checking the advisory database on GitHub.

Related vulnerabilities

Recent vulnerabilities recorded for lxml.

How To Fix

Latest published version: 6.1.3 as of 22 Oct 2026

pip install --upgrade "lxml==6.1.3"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

6.1.0

This is the first release that contains the fix.

pip install --upgrade "lxml==6.1.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback