Skip to main content

lxml CVE-2026-41066

HIGH
Improper Restriction of XML External Entity Reference (CWE-611)
2026-04-21 https://github.com/lxml/lxml GHSA-vfmq-68hx-4jfw
7.5
CVSS 3.1 · Vendor: https://github.com/lxml/lxml
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted XML to parsing endpoint
  2. Delivery
    DOCTYPE defines external file entity
  3. Exploit
    iterparse/ETCompatXMLParser resolves entity
  4. Execution
    Parser reads local file contents
  5. Impact
    Sensitive file data returned or exfiltrated

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A02:2025 - Security Misconfiguration
ASVS 5.0
V13 - Configuration XML external entity prevention
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the target application parse attacker-controlled XML using one of two specific lxml APIs in their default configuration: iterparse() or ETCompatXMLParser() with resolve_entities=True (the pre-6.1.0 default). Applications using lxml's standard etree.XMLParser/HTMLParser are NOT affected, since those defaulted to the safe setting in 5.0. No authentication or user interaction is needed (PR:N/UI:N), and it works against default configurations of those two parsers. Limiting factors: the application must actually reach one of the two vulnerable parsers with untrusted input, must be running lxml < 6.1.0, and meaningful data exfiltration typically requires the app to reflect parsed content back or permit out-of-band (blind XXE) retrieval; a purely internal parse that discards output limits practical impact.

Impact

The signals are consistent but point to low real-world urgency despite the High CVSS. The CVSS 3.1 base score of 7.5 reflects an easy network vector (AV:N/AC:L/PR:N/UI:N) with High confidentiality impact and no integrity/availability effect - accurate for the raw primitive. However, EPSS is only 0.03% (9th percentile), no CISA KEV listing exists, and CISA SSVC records Exploitation: none with Technical Impact: partial, all indicating this is not under active or opportunistic attack. SSVC Automatable: yes is worth noting: because exploitation needs no authentication or user interaction, it could be scripted against any exposed vulnerable endpoint. The key nuance the CVSS score hides is scope of exposure: the flaw is only reachable if the host application specifically calls iterparse() or ETCompatXMLParser() on attacker-controlled XML - most lxml usage (the default etree parser) was already safe since 5.0. Also, real-world confidentiality impact depends on the application returning parsed content or supporting out-of-band exfiltration; blind XXE may limit true impact below C:H. Overall: a genuine but conditional issue, high-priority to patch only for applications known to use the two affected parsers on untrusted input.

Exploit ScenarioDerived

An application ingests user-supplied XML - for example an API endpoint, file-upload feature, or webhook - and streams it through lxml's iterparse() or ETCompatXMLParser() with default settings. The attacker submits an XML document containing a DOCTYPE that defines an external entity referencing file:///etc/passwd (or an application secret/config file), and the parser resolves it, embedding the file contents into the parsed output returned to or observable by the attacker. No public exploit code is identified at this time, but the technique is standard XXE and requires no authentication or user interaction.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 24, 2026

Local file disclosure via XML External Entity (XXE) injection affects the lxml Python library (versions < 6.1.0) when applications parse untrusted XML using iterparse() or ETCompatXMLParser(), whose default configuration left resolve_entities=True. An unauthenticated remote attacker who can submit crafted XML to such an endpoint can read arbitrary local files readable by the process. There is no public exploit identified at time of analysis and EPSS risk is very low (0.03%), but exploitation is trivial (CVSS 7.5, AV:N/AC:L/PR:N/UI:N) wherever these two specific parsers are used.

RemediationAI

Vendor-released patch: lxml 6.1.0 - upgrade to lxml >= 6.1.0, which changes the default to resolve_entities='internal' for all parsers including iterparse() and ETCompatXMLParser(), disabling local file access by default (release: https://github.com/lxml/lxml/releases/tag/lxml-6.1.0; advisory: https://github.com/lxml/lxml/security/advisories/GHSA-vfmq-68hx-4jfw). If immediate upgrade is not possible, apply the vendor workaround in code by explicitly passing resolve_entities='internal' (preserves internal entity expansion) or resolve_entities=False (disables entity resolution entirely) to every iterparse() and ETCompatXMLParser() call that processes untrusted XML; the trade-off is that resolve_entities=False will break any legitimate document that depends on entity substitution, so validate that dependent XML still parses correctly. For distro-packaged installations (SUSE, Red Hat), apply the vendor backport once released rather than side-loading pip. As defense in depth, ensure the parsing process runs with least-privilege filesystem access so that even a successful XXE reads little of value.

Affected Packages

pypi lxml fix: 6.1.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

lxml is a widely used Python binding to the libxml2/libxslt C libraries for XML and HTML processing. The root cause is CWE-611 (Improper Restriction of XML External Entity Reference): when a parser resolves external entities, an attacker-supplied DOCTYPE declaration can define an entity pointing at a local file path (e.g. file:///etc/passwd), and the parser substitutes the file contents into the document. lxml hardened its mainline XML and HTML parsers in 5.0 by switching the default to resolve_entities='internal', but two legacy entry points - the streaming iterparse() API and the ETCompatXMLParser() compatibility class - were overlooked and continued defaulting to resolve_entities=True. The affected component is the pip package lxml (CPE pkg:pip/lxml); the flaw is in the parser default configuration, not in libxml2 itself.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/lxml/lxml) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
vuln.today AI 7.5 HIGH

Remote, unauthenticated, no interaction against the default parser config yields AV:N/AC:L/PR:N/UI:N; arbitrary local file read gives C:H with no integrity or availability impact.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Red Hat 5.9 MEDIUM

Primary rating from Vendor (https://github.com/lxml/lxml).

CVSS VectorVendor: https://github.com/lxml/lxml

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Lifecycle Timeline

2
Patch released
Apr 22, 2026 - 02:30 nvd
Patch available
CVE Published
Apr 21, 2026 - 20:38 nvd
HIGH 7.5

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

The lxml Python library (versions prior to 6.1.0) contains a vulnerability that allows remote attackers to read sensitive files from affected servers without authentication. This could expose confidential data, credentials, and system configurations for any organization using affected versions-particularly those processing untrusted XML documents.

Business Impact: High
Compensating Controls

Vendor-released patch: lxml 6.1.0 or later. If patching is delayed, disable XXE resolution by setting resolve_entities=False in iterparse() and ETCompatXMLParser() configurations.

Threat Intelligence Overview

EPSS Score
0.0%
Top 91% exploitable
Prevalence
High
lxml is one of the most widely deployed Python XML libraries
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

XML External Entity (XXE) attacks exploit XML parsers that process Document Type Definitions (DTDs) without proper restrictions.

Affected Products (CPE)CVE.org

pkg:pip/lxml

Vendor StatusVendor

SUSE

Product Status
openSUSE Tumbleweed Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy