Denial of Service Vulnerability in libxml2 and lxml Packages

libxml2 Updated 02 Oct 2025

Summary

05/07/2022
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2022-2309: NULL Pointer Dereference allows attackers to cause a denial of service (or application crash). Affects libxml2 versions < 2.9.10+dfsg-6.7+deb11u5. Fixed in 2.9.10+dfsg-6.7+deb11u5. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

libxml2 is a widely-used XML parsing library that provides a range of functionalities for processing XML and HTML documents. It is known for its performance and compliance with standards. lxml is a Python binding for libxml2, allowing Python developers to leverage the capabilities of libxml2 in their applications. This vulnerability affects versions of libxml2 from 2.9.10 to 2.9.14, which can lead to application crashes when used with lxml under certain conditions.

Vulnerability Detail

The vulnerability identified as DEBIAN-CVE-2022-2309 is a NULL Pointer Dereference that allows attackers to cause a denial of service or application crash. This issue arises when the iterwalk function is used in conjunction with libxml2 versions 2.9.10 through 2.9.14. The vulnerability can be exploited by sending forged input data to applications that utilize this code sequence, potentially leading to crashes. It is important to note that libxml2 versions 2.9.9 and earlier are not affected by this issue.

How To Fix

Minimum fixed version

2.9.10+dfsg-6.7+deb11u5

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libxml2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate patching is not possible, consider avoiding the use of the iterwalk function with untrusted input. Instead, utilize the iterparse function, which is more efficient and does not expose the application to this vulnerability.

Conclusion

The DEBIAN-CVE-2022-2309 vulnerability poses a significant risk to applications using libxml2 and lxml, particularly when handling untrusted input. It is crucial to update to the patched versions of these packages to mitigate the risk of denial of service attacks. Users are encouraged to monitor their applications for vulnerabilities using tools like Vulert.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

The vulnerability is a NULL Pointer Dereference that can lead to application crashes when specific functions are used with vulnerable versions of libxml2.

libxml2 versions 2.9.10 through 2.9.14 are affected by this vulnerability.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software using a manifest file. Check your application against this vulnerability using the Vulert playground at Vulert Scanner.

As a temporary measure, avoid using the iterwalk function with untrusted input and consider using the iterparse function instead.

While the primary risk is a denial of service, which can crash the application, there is no direct indication of data loss associated with this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for libxml2.

How To Fix

Minimum fixed version

2.9.10+dfsg-6.7+deb11u5

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libxml2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback