Denial of Service Vulnerability in libxml2: Exponential Entity Expansion Attack

libxml2 Updated 02 Oct 2025

Summary

09/07/2021
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2021-3541: A flaw was found in libxml2. Exponential entity expansion attack its possible bypassing all existing protection mechanisms and leading to denial of service. Affects libxml2 versions < 2.9.10+dfsg-6.7. Fixed in 2.9.10+dfsg-6.7. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

libxml2 is a widely-used XML parsing library that provides a variety of functionalities for handling XML documents. It is known for its performance and compliance with standards, making it a popular choice for applications that require XML processing. However, libxml2 is susceptible to vulnerabilities that can be exploited to cause denial of service, particularly through entity expansion attacks.

Vulnerability Detail

A flaw was found in libxml2 that allows for an exponential entity expansion attack. This vulnerability can bypass existing protection mechanisms, potentially leading to a denial of service. Attackers can exploit this flaw by crafting XML documents that trigger excessive resource consumption, which can crash or severely degrade the performance of the application utilizing libxml2.

How To Fix

Minimum fixed version

2.9.10+dfsg-6.7

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

As a temporary workaround, you can implement input validation to limit the size and complexity of XML documents processed by your application. This can help mitigate the risk of denial of service attacks until the package is updated.

Conclusion

The vulnerability in libxml2 poses a significant risk due to the potential for denial of service through exponential entity expansion attacks. It is crucial for users of libxml2 to update to the latest patched version and implement necessary workarounds to safeguard their applications.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

The vulnerability allows for an exponential entity expansion attack, which can lead to denial of service by consuming excessive resources.

You can use Vulert to monitor and alert for open-source vulnerabilities. By checking your manifest file like package-lock.json, you can identify if your application is affected.

Update libxml2 to version 2.9.10+dfsg-6.7 or later to patch the vulnerability. Implement input validation as a temporary measure.

Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

Failure to address this vulnerability may lead to denial of service, where your application could become unresponsive or crash due to resource exhaustion.

Related vulnerabilities

Recent vulnerabilities recorded for libxml2.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.9.10+dfsg-6.7

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