Skip to content
DoS Disclosed report Intermediate CVE-2022-2309

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

A NULL pointer dereference in lxml's iterwalk function (also used by canonicalize) when combined with libxml2 versions 2.9.10 to 2.9.14 allows an attacker to trigger a crash by supplying forged XML input. This can cause a denial of service or application crash if untrusted input is processed through iterwalk.

lxml/lxml

Originally disclosed on huntr

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.

From the GitHub Advisory Database (GHSA-wrxv-2j5q-m38w, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a NULL pointer dereference in the iterwalk function (and canonicalize) when used with libxml2 2.9.10 through 2.9.14, triggered by forged input data.

Impact

An attacker could cause a denial of service or application crash by supplying forged input to a vulnerable code sequence that uses iterwalk, but only when lxml is used with libxml2 2.9.10 through 2.9.14.

What the attacker needed

Lxml with libxml2 2.9.10-2.9.14; application uses iterwalk or canonicalize; untrusted input reaches the vulnerable function

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A NULL pointer dereference is a programming error where the code tries to use a memory address that points to nothing, which makes the program crash. Here, if a program uses a specific lxml function to walk through XML data and processes untrusted input, an attacker can send crafted XML that causes that crash. This only happens with certain versions of the underlying libxml2 library.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.