CVE-2022-2309: lxml NULL Pointer Dereference allows attackers to cause a denial of service

CVE-2022-2309 · Severity: low · CVSS 3 · Published 2022-07-05

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.

Technologies: lxml (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2022-2309 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2022-2309 being exploited in the wild.
How severe is CVE-2022-2309?
Low severity, with a CVSS score of 3, published 5 July 2022.
Which products and versions are affected?
lxml (PyPI) ECOSYSTEM:introduced=0,fixed=4.9.1, GIT:introduced=0,fixed=86368e9cf70a0ad23cccd5ee32de847149af0c6f|ECOSYSTEM:introduced=0,fixed=4.9.1.
Is there a fix for CVE-2022-2309?
Yes. lxml (PyPI): upgrade to 4.9.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
Am I affected by CVE-2022-2309?
Check whether you run lxml (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • lxml (PyPI): upgrade to 4.9.1 or later
    pip install "lxml>=4.9.1"

Affected products

  • lxml (PyPI) ECOSYSTEM:introduced=0,fixed=4.9.1, GIT:introduced=0,fixed=86368e9cf70a0ad23cccd5ee32de847149af0c6f|ECOSYSTEM:introduced=0,fixed=4.9.1

Identifiers

  • CVE-2022-2309
  • GHSA-wrxv-2j5q-m38w
  • PYSEC-2022-230

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.