Denial of Service Vulnerability in libxml2: Infinite Loop Risk

libxml2 Updated 02 Oct 2025

Summary

04/04/2018
N/A
Yes i
Medium
5.3

ALPINE-CVE-2018-9251: The xz_decomp function in xzlib.c in libxml2 2.9.8, if --with-lzma is used, allows remote attackers to cause a denial of service (infinite loop) via a crafted XML file that triggers LZMA_MEMLIMIT_ERROR, as demonstrated b... Affects libxml2 versions < 2.9.8-r1. Fixed in 2.9.8-r1. 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 documents. It is known for its speed and efficiency, making it a popular choice for applications requiring XML parsing. However, libxml2 has a vulnerability that can lead to denial of service under specific conditions, particularly when the library is compiled with LZMA support.

Vulnerability Detail

The vulnerability arises from the xz_decomp function in xzlib.c within libxml2 version 2.9.8. If the library is compiled with the --with-lzma option, it becomes susceptible to a crafted XML file that triggers an infinite loop due to LZMA_MEMLIMIT_ERROR. This can lead to a denial of service, as the affected application may become unresponsive when processing such malicious XML files. The vulnerability is distinct from CVE-2015-8035 and poses a risk to any application utilizing libxml2 for XML parsing.

How To Fix

Minimum fixed version

2.9.8-r1

This is the first release that contains the fix.

sudo apk add --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 feasible, consider disabling LZMA support during the compilation of libxml2 by omitting the --with-lzma option. This will prevent the vulnerability from being triggered by crafted XML files.

Conclusion

The vulnerability in libxml2 poses a significant risk of denial of service due to an infinite loop triggered by specific crafted XML files. It is crucial for users of libxml2 to update to the patched version or implement workarounds to safeguard their applications.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 5.3, indicating a moderate level of risk.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The primary consequence is denial of service, where the application may become unresponsive when processing malicious XML files.

Yes, updating to libxml2 version 2.9.8-r1 or later will mitigate the vulnerability.

As a temporary measure, you can disable LZMA support during compilation to avoid triggering the vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for libxml2.

How To Fix

Minimum fixed version

2.9.8-r1

This is the first release that contains the fix.

sudo apk add --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