Vulnerability · Published Jul 5, 2022 · Assigned by @huntrdev
CVE-2022-2309NULL Pointer Dereference in lxml/lxml
Medium 5.3
In plain English
A medium-severity null pointer dereference in lxml/lxml from lxml. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 2.4% (higher than 84% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:9 | python3-lxml | 4.6.5-3.el9 | ALSA-2022:8226 |
| Alpine:v3.20 | libxml2 | 2.10.0-r0 | ALPINE-CVE-2022-2309 |
| Alpine:v3.21 | libxml2 | 2.10.0-r0 | ALPINE-CVE-2022-2309 |
| Alpine:v3.22 | libxml2 | 2.10.0-r0 | ALPINE-CVE-2022-2309 |
| Alpine:v3.23 | libxml2 | 2.10.0-r0 | ALPINE-CVE-2022-2309 |
| Alpine:v3.24 | libxml2 | 2.10.0-r0 | ALPINE-CVE-2022-2309 |
| Alpine:v3.20 | py3-lxml | 4.9.2-r0 | ALPINE-CVE-2022-2309 |
| Alpine:v3.21 | py3-lxml | 4.9.2-r0 | ALPINE-CVE-2022-2309 |
| Alpine:v3.22 | py3-lxml | 4.9.2-r0 | ALPINE-CVE-2022-2309 |
| Alpine:v3.23 | py3-lxml | 4.9.2-r0 | ALPINE-CVE-2022-2309 |
| Alpine:v3.24 | py3-lxml | 4.9.2-r0 | ALPINE-CVE-2022-2309 |
| Debian:12 | libxml2 | 2.9.14+dfsg-1.3~deb12u1 | DEBIAN-CVE-2022-2309 |
| Debian:13 | libxml2 | 2.9.14+dfsg-1.3 | DEBIAN-CVE-2022-2309 |
| Debian:14 | libxml2 | 2.9.14+dfsg-1.3 | DEBIAN-CVE-2022-2309 |
| Debian:12 | lxml | 4.9.1-1 | DEBIAN-CVE-2022-2309 |
| Debian:13 | lxml | 4.9.1-1 | DEBIAN-CVE-2022-2309 |
| Debian:14 | lxml | 4.9.1-1 | DEBIAN-CVE-2022-2309 |
| PyPI | lxml | 4.9.1 | PYSEC-2022-230 |
| PyPI | lxml | 4.9.1 | GHSA-wrxv-2j5q-m38w |
| Rocky Linux:9 | python-lxml | 0:4.6.5-3.el9 | RLSA-2022:8226 |
| Ubuntu:22.04:LTS | libxml2 | 2.9.13+dfsg-1ubuntu0.2 | USN-5760-1 |
| Ubuntu:22.04:LTS | libxml2 | 2.9.13+dfsg-1ubuntu0.2 | UBUNTU-CVE-2022-2309 |
| Ubuntu:22.04:LTS | lxml | no fix listed | UBUNTU-CVE-2022-2309 |
Affected products (as reported)
Weakness: CWE-476 · Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
References
- https://huntr.dev/bounties/8264e74f-edda-4c40-9956-49de635105ba x_refsource_CONFIRM
- https://github.com/lxml/lxml/commit/86368e9cf70a0ad23cccd5ee32de847149af0c6f x_refsource_MISC
- GLSA-202208-06 vendor-advisory, x_refsource_GENTOO
- https://security.netapp.com/advisory/ntap-20220915-0006/ x_refsource_CONFIRM
- FEDORA-2022-ed0eeb6a20 vendor-advisory, x_refsource_FEDORA
- FEDORA-2022-ed17f59c1d vendor-advisory, x_refsource_FEDORA
- https://lists.debian.org/debian-lts-announce/2024/09/msg00021.html