Critical Vulnerability in libxml2: Potential for XML External Entity (XXE) Attacks

libxml2 Updated 03 Oct 2025

Summary

16/01/2025
N/A
Yes i
Unrated
Not published

USN-7215-1: libxml2 vulnerability. 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 Devnack Your last release was probably never penetration tested 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 integral to many applications and systems, offering features such as validation, parsing, and transformation of XML data. However, a recently discovered vulnerability exposes it to XML External Entity (XXE) attacks, which can compromise the security of applications relying on this library.

Vulnerability Detail

Xisco Fauli discovered that libxml2 incorrectly handled custom SAX handlers. This flaw allows a remote attacker to exploit the vulnerability and perform XML External Entity (XXE) attacks, potentially leading to unauthorized access to sensitive data or system resources. The vulnerability is identified as CVE-2024-40896 and affects versions prior to 2.12.7+dfsg-3ubuntu0.1.

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 measure, consider disabling the use of custom SAX handlers in your application until the package can be updated. This may help mitigate the risk of exploitation while a permanent fix is being implemented.

Conclusion

The libxml2 vulnerability presents a significant risk due to the potential for XML External Entity (XXE) attacks. It is crucial for users and developers to update to the patched version to safeguard their applications. Utilizing tools like Vulert can help in monitoring and managing vulnerabilities effectively.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

libxml2 is an XML parsing library that provides tools for reading, manipulating, and writing XML documents. It is commonly used in various software applications.

An XXE attack occurs when an attacker is able to exploit a vulnerable XML parser to gain access to sensitive data or execute unauthorized commands by including external entities in XML documents.

You can use Vulert, a tool that monitors open-source vulnerabilities in your software. By uploading your manifest file, such as package-lock.json, you can quickly assess if your application is impacted.

Yes, you can disable the use of custom SAX handlers in your application as a temporary workaround until you can update the libxml2 package.

Detailed information about this vulnerability can be found in the Ubuntu Security Notices, specifically USN-7215-1, which outlines the issue and the necessary updates.

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