Critical Use-After-Free Vulnerability in libxml2 Affects XML Reader Interface

libxml2 Updated 02 Oct 2025

Summary

04/02/2024
N/A
Yes i
High
7.5

ALPINE-CVE-2024-25062: An issue was discovered in libxml2 before 2.11.7 and 2.12.x before 2.12.5. Affects libxml2 versions < 2.11.7-r0. Fixed in 2.11.7-r0. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

libxml2 is a widely used XML parsing library that provides a range of functionalities for processing XML documents. It supports various features such as DTD validation and XInclude expansion, making it a critical component in many applications that handle XML data. However, certain versions of libxml2 are vulnerable to a use-after-free issue when these features are enabled, which can lead to severe security implications.

Vulnerability Detail

An issue was discovered in libxml2 before version 2.11.7 and in the 2.12.x series before version 2.12.5. The vulnerability arises when the XML Reader interface is used with DTD validation and XInclude expansion enabled. Processing specially crafted XML documents can result in a use-after-free condition in the xmlValidatePopElement function. This can potentially allow an attacker to execute arbitrary code, leading to a complete compromise of the affected system.

How To Fix

Minimum fixed version

2.11.7-r0

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

As a temporary workaround, consider disabling DTD validation and XInclude expansion in your XML processing if possible. This can mitigate the risk of exploitation until the package is updated.

Conclusion

The libxml2 library has a critical vulnerability that can lead to severe security risks if not addressed. Users are strongly advised to update to the patched versions as soon as possible to protect their systems from potential exploitation.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

Versions of libxml2 prior to 2.11.7 and 2.12.x before 2.12.5 are affected by this vulnerability.

You can use Vulert, which monitors open-source vulnerabilities in your software. By uploading your manifest file like package-lock.json, you can check for vulnerabilities in real-time.

Yes, you can temporarily disable DTD validation and XInclude expansion in your XML processing to reduce the risk of exploitation.

More information can be found in the CVE-2024-25062 details and the Alpine Linux security advisories.

Related vulnerabilities

Recent vulnerabilities recorded for libxml2.

How To Fix

Minimum fixed version

2.11.7-r0

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