Critical XXE Vulnerability in libxml2: Exploitable SAX Parser Flaw

libxml2 Updated 03 Oct 2025

Summary

23/12/2024
N/A
Yes i
Critical
9.1

UBUNTU-CVE-2024-40896: In libxml2 2.11 before 2.11.9, 2.12 before 2.12.9, and 2.13 before 2.13.3, the SAX parser can produce events for external entities even if custom SAX handlers try to override entity content (by setting "checked"). Affects libxml2 versions < 2.12.7+dfsg-3ubuntu0.1. Fixed in 2.12.7+dfsg-3ubuntu0.1. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

libxml2 is a widely used XML parsing library that provides a variety of functionalities for processing XML documents. It is known for its performance and compliance with standards, making it a popular choice in many applications. However, certain versions of libxml2 are vulnerable to an XML External Entity (XXE) attack, which can lead to unauthorized access to sensitive data.

Vulnerability Detail

The vulnerability exists in libxml2 versions 2.11 before 2.11.9, 2.12 before 2.12.9, and 2.13 before 2.13.3, where the SAX parser can produce events for external entities despite custom SAX handlers attempting to override entity content. This flaw allows attackers to exploit XXE attacks, potentially leading to data exposure and system compromise. The vulnerability has a CVSS score of 9.1, indicating a high severity level.

How To Fix

Minimum fixed version

2.12.7+dfsg-3ubuntu0.1

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, consider disabling the use of external entities in your XML processing if possible. This can be done by configuring your SAX parser settings to ignore external entities, thus mitigating the risk until the package is updated.

Conclusion

The libxml2 package has a critical vulnerability that allows for XXE attacks due to flaws in its SAX parser. It is essential to update to the patched version to secure your applications and prevent potential data breaches. Utilize tools like Vulert to monitor your software for vulnerabilities effectively.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

An XML External Entity (XXE) attack is a type of security vulnerability that allows an attacker to interfere with the processing of XML data. It can lead to data exposure and system compromise.

You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software. Simply upload your manifest file, such as package-lock.json, to check for vulnerabilities.

Failure to address this vulnerability may result in unauthorized access to sensitive data, data breaches, and potential system compromise.

Yes, you can temporarily disable the use of external entities in your XML processing to reduce the risk of exploitation until you can apply the patch.

Detailed information about this vulnerability can be found in the Ubuntu Security Notices and on the official libxml2 documentation.

Related vulnerabilities

Recent vulnerabilities recorded for libxml2.

How To Fix

Minimum fixed version

2.12.7+dfsg-3ubuntu0.1

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