Denial of Service Vulnerability in libxml2: Exponential Entity Expansion Attack
Summary
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 ↓
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.
No signup required · Results in about 60 seconds
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 →
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.
References
Related vulnerabilities
Recent vulnerabilities recorded for libxml2.