pypi package report

Is lxml safe?

7 known vulnerabilities, worst severity HIGH.

// reach

4 direct dependencies

2 carry known advisories, worst HIGH

533 packages depend on it

an advisory here reaches each of them

Create a free accountfor every dependency path, dependent and what to upgrade
// ai model usage

No published models are known to use this package.


cvss
7.5
high

CVSS v3.1 base score out of 10

epss
0.32%
low

chance of exploitation in 30 days, 26th percentile of all CVEs

xyz score
4.9
medium

CyberXYZ composite out of 10

fig. 01 — GHSA-vfmq-68hx-4jfw, the advisory selected below

// 7 advisories

GHSA-vfmq-68hx-4jfw

HIGHGitHub ratingCVE-2026-41066
// 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.

// cvss v3.1 vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Checked 2026-11-06 at 22:34 UTC. The most recent advisory here was published 2026-04-21. Updated continuously from NVD, GHSA, OSV and CNA feeds.

Think a verdict here is wrong? Tell us — we respond within 2 business days.