Skip to content
OpenAdvisories
Medium · 5.3 CVE-2022-2309 EUVD-2022-0148GHSA-wrxv-2j5q-m38wPYSEC-2022-230

NULL Pointer Dereference in lxml/lxml

Published Jul 5, 2022 · Updated Nov 4, 2025 · Assigned by @huntrdev

Description

NULL Pointer Dereference allows attackers to cause a denial of service (or application crash). This only applies when lxml is used together with libxml2 2.9.10 through 2.9.14. libxml2 2.9.9 and earlier are not affected. It allows triggering crashes through forged input data, given a vulnerable code sequence in the application. The vulnerability is caused by the iterwalk function (also used by the canonicalize function). Such code shouldn't be in wide-spread use, given that parsing + iterwalk would usually be replaced with the more efficient iterparse function. However, an XML converter that serialises to C14N would also be vulnerable, for example, and there are legitimate use cases for this code sequence. If untrusted input is received (also remotely) and processed via iterwalk function, a crash can be triggered.

Affected products

VendorProductAffectedFixed
lxml lxml/lxml unspecified – < 4.9.1 4.9.1

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 libxml2 2.9.14+dfsg-1.3 —
Debian 14 lxml 4.9.1-1 —
Debian 13 libxml2 2.9.14+dfsg-1.3 —
Debian 13 lxml 4.9.1-1 —
Debian 12 libxml2 2.9.14+dfsg-1.3~deb12u1 —
Debian 12 lxml 4.9.1-1 —
Debian 11 libxml2 2.9.10+dfsg-6.7+deb11u5 DLA-3878-1
ReleasePackageFixed inAdvisory
Ubuntu 22.04 LTS libxml2 2.9.13+dfsg-1ubuntu0.2 USN-5760-1
Ubuntu 22.04 LTS lxml No fix yet —
Ubuntu 20.04 LTS libxml2 2.9.10+dfsg-5ubuntu0.20.04.5 USN-5760-1
Ubuntu 18.04 LTS libxml2 2.9.4+dfsg1-6.1ubuntu1.8 USN-5760-1
Show 4 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 20.04 LTS lxml No fix yet —
Ubuntu Pro 18.04 LTS lxml No fix yet —
Ubuntu Pro 16.04 LTS lxml No fix yet —
Ubuntu Pro 14.04 LTS lxml No fix yet —
ReleasePackageFixed inAdvisory
RHEL 9 python-lxml +1 4.6.5-3.el9 RHSA-2022:8226

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 9 python3-lxml 4.6.5-3.el9 ALSA-2022:8226

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 9 python-lxml 4.6.5-3.el9 RLSA-2022:8226
ReleasePackageFixed inAdvisory
SLES 15 SP4 python-lxml 4.7.1-150200.3.10.1 SUSE-SU-2022:2908-1
SLES 15 SP3 python-lxml 4.7.1-150200.3.10.1 SUSE-SU-2022:2908-1
SLES 15 SP2 python-lxml 4.7.1-150200.3.10.1 SUSE-SU-2022:2908-1
SLES 15 python-lxml 4.7.1-150100.6.6.1 SUSE-SU-2022:2878-1
SLES 2 python-lxml 4.7.1-150200.3.10.1 SUSE-SU-2022:2908-1
Show 6 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 15 SP2 python-lxml 4.7.1-150200.3.10.1 SUSE-SU-2022:2908-1
SLE HPC 15 SP2 python-lxml 4.7.1-150200.3.10.1 SUSE-SU-2022:2908-1
SUSE Manager Server 4.1 python-lxml 4.7.1-150200.3.10.1 SUSE-SU-2022:2908-1
SUSE Manager Retail Branch Server 4.1 python-lxml 4.7.1-150200.3.10.1 SUSE-SU-2022:2908-1
SUSE Manager Proxy 4.1 python-lxml 4.7.1-150200.3.10.1 SUSE-SU-2022:2908-1
SUSE Enterprise Storage 7 python-lxml 4.7.1-150200.3.10.1 SUSE-SU-2022:2908-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed libxml2 2.10.1-1.1 openSUSE-SU-2024:12290-1
openSUSE Leap 15.4 python-lxml 4.7.1-150200.3.10.1 SUSE-SU-2022:2908-1
openSUSE Leap 15.3 python-lxml 4.7.1-150200.3.10.1 SUSE-SU-2022:2908-1
ReleasePackageFixed inAdvisory
Alpine v3.24 libxml2 2.10.0-r0 —
Alpine v3.24 py3-lxml 4.9.2-r0 —
Alpine v3.23 libxml2 2.10.0-r0 —
Alpine v3.23 py3-lxml 4.9.2-r0 —
Alpine v3.22 libxml2 2.10.0-r0 —
Alpine v3.22 py3-lxml 4.9.2-r0 —
Alpine v3.21 libxml2 2.10.0-r0 —
Alpine v3.21 py3-lxml 4.9.2-r0 —
Alpine v3.20 libxml2 2.10.0-r0 —
Alpine v3.20 py3-lxml 4.9.2-r0 —
Show 7 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 libxml2 2.10.0-r0 —
Alpine v3.19 py3-lxml 4.9.2-r0 —
Alpine v3.18 libxml2 2.10.0-r0 —
Alpine v3.18 py3-lxml 4.9.2-r0 —
Alpine v3.17 libxml2 2.10.0-r0 —
Alpine v3.17 py3-lxml 4.9.2-r0 —
Alpine v3.16 libxml2 2.9.14-r1 —
Alpine v3.15 libxml2 2.9.14-r1 —
Alpine v3.14 libxml2 2.9.14-r1 —
Alpine v3.13 libxml2 2.9.14-r1 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 python3-lxml 4.7.1-3.amzn2023.0.1 ALAS2023-2023-034

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 2 (CBL-Mariner) libxml2 2.10.0-1 —
Azure Linux 2 (CBL-Mariner) python-lxml 4.9.1-1 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 python3-lxml 4.6.5-3.el9 ELSA-2022-8226

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI lxml < 4.9.1 4.9.1 GHSA-wrxv-2j5q-m38w

Advisories 14

References