lxml vulnerabilities

Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.

Registry
PyPI
Latest
6.1.3
License
BSD-3-Clause

7 known advisories

The latest version, 6.1.3, is not affected by any of them. Projects on older versions may be.

Update to the latest version:pip install 'lxml>=6.1.3'

Is your project on an affected lxml?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Security advisories for lxml

  • HighCVE-2026-41066GHSA-vfmq-68hx-4jfw21 Apr 2026

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

    Affected
    <6.1.0
    Fixed in
    6.1.0
  • MediumCVE-2022-2309GHSA-wrxv-2j5q-m38w6 Jul 2022

    lxml NULL Pointer Dereference allows attackers to cause a denial of service

    Affected
    <4.9.1
    Fixed in
    4.9.1
  • MediumCVE-2014-3146GHSA-57qw-cc2g-pv5p14 May 2022

    lxml Cross-site Scripting Via Control Characters

    Affected
    <3.3.5
    Fixed in
    3.3.5
  • MediumCVE-2018-19787GHSA-xp26-p53h-6h2p13 May 2022

    Improper Neutralization of Input During Web Page Generation in LXML

    Affected
    <4.2.5
    Fixed in
    4.2.5
  • MediumCVE-2021-43818GHSA-55x5-fj6c-h6m813 Dec 2021

    lxml's HTML Cleaner allows crafted and SVG embedded scripts to pass through

    Affected
    <4.6.5
    Fixed in
    4.6.5
  • MediumCVE-2021-28957GHSA-jq4v-f5q6-mjqq22 Mar 2021

    lxml vulnerable to Cross-Site Scripting

    Affected
    <4.6.3
    Fixed in
    4.6.3
  • MediumCVE-2020-27783GHSA-pgww-xf46-h92r7 Jan 2021

    lxml vulnerable to Cross-site Scripting

    Affected
    <4.6.2
    Fixed in
    4.6.2

Is your lxml version vulnerable?

Which of your client projects still run an old lxml?

NPMscan reads the requirements.txt, poetry.lock, uv.lock and Pipfile.lock in every GitHub repo you pick and checks each installed version against these advisories, including the packages your packages pull in. Each finding comes with the command that fixes it.

Other PyPI packages

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily. Package details from the PyPI registry.