Use-after-free vulnerability in libxml2

libxml2 Updated 02 Oct 2025

Summary

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

CVE-2024-25062: An issue was discovered in libxml2 before 2.11.7 and 2.12.x before 2.12.5. Affects libxml2 across 3 version ranges.

< 2.11.7-r0 >= 5e9b167dce73bd6a804ab107ae4c4b95e6849597, < e189e9945317ad4c8603fa2300d11d11f5e2e335 < 8711320065405c4bb08aaccd4bd2881450b5ce41

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 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 popular open-source library for parsing and manipulating XML documents. It provides various interfaces for XML processing, including the XML Reader interface. The library is widely used in many applications and frameworks. However, versions before 2.11.7 and 2.12.x before 2.12.5 of libxml2 are vulnerable to a use-after-free vulnerability when using the XML Reader interface with DTD validation and XInclude expansion enabled.

Vulnerability Detail

The use-after-free vulnerability in libxml2 occurs when processing crafted XML documents. This vulnerability can be exploited by an attacker to cause a denial-of-service condition or potentially execute arbitrary code. The issue arises due to a use-after-free error in the xmlValidatePopElement function. An attacker can craft a malicious XML document that triggers the use-after-free condition, leading to a crash or potential code execution.

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

There is no known workaround for this vulnerability. It is essential to update libxml2 to the fixed version as soon as possible.

Conclusion

The use-after-free vulnerability in libxml2 can have severe consequences, including denial-of-service and potential code execution. It is highly recommended to update libxml2 to version 2.11.7 or later to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

libxml2 is an open-source library for parsing and manipulating XML documents. It provides various interfaces for XML processing and is widely used in many applications and frameworks.

A use-after-free vulnerability occurs when a program continues to use a memory area after it has been freed. In the case of libxml2, this vulnerability can be exploited to cause a crash or potentially execute arbitrary code.

An attacker can craft a malicious XML document that triggers the use-after-free condition in libxml2. By exploiting this vulnerability, the attacker can cause a denial-of-service condition or potentially execute arbitrary code.

Yes, a fix for this vulnerability is available in libxml2 version 2.11.7 and later. It is recommended to update libxml2 to the latest fixed version to mitigate the risk.

No, there are no known workarounds for this vulnerability. It is crucial to update libxml2 to the fixed version as soon as possible.

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