Critical Use-After-Free Vulnerability in libxml2: CVE-2024-56171

libxml2 Updated 03 Oct 2025

Summary

18/02/2025
N/A
Yes i
High
7.8

UBUNTU-CVE-2024-56171: libxml2 before 2.12.10 and 2.13.x before 2.13.6 has a use-after-free in xmlSchemaIDCFillNodeTables and xmlSchemaBubbleIDCNodeTables in xmlschemas.c. Affects libxml2 versions < 2.9.1+dfsg1-3ubuntu4.13+esm7. Fixed in 2.9.1+dfsg1-3ubuntu4.13+esm7. 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 is known for its performance and compliance with standards. However, it has been found to be vulnerable to a use-after-free issue, which can lead to potential exploitation if not addressed promptly.

Vulnerability Detail

The vulnerability identified as CVE-2024-56171 affects libxml2 versions prior to 2.12.10 and 2.13.x before 2.13.6. It is caused by a use-after-free condition in the functions xmlSchemaIDCFillNodeTables and xmlSchemaBubbleIDCNodeTables within xmlschemas.c. This vulnerability can be exploited by an attacker through a crafted XML document that is validated against an XML schema with specific identity constraints, or by using a specially crafted XML schema. The ramifications of this vulnerability include potential memory corruption, leading to application crashes or arbitrary code execution, making it critical to address.

How To Fix

Minimum fixed version

2.9.1+dfsg1-3ubuntu4.13+esm7

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, users can avoid processing untrusted XML documents or schemas until the library is updated. Additionally, implementing strict validation checks on XML inputs may help mitigate the risk of exploitation.

Conclusion

The CVE-2024-56171 vulnerability in libxml2 poses significant risks due to its potential for exploitation through crafted XML documents. It is crucial for users to update to the latest patched versions to safeguard their applications against this critical issue.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

CVE-2024-56171 is a critical vulnerability in the libxml2 library that allows for a use-after-free condition, potentially leading to memory corruption and arbitrary code execution.

You can use Vulert to monitor and alert in real-time for open-source vulnerabilities. Visit Vulert Scanner to check if your application is affected without needing to sign up.

Versions of libxml2 prior to 2.12.10 and 2.13.x before 2.13.6 are affected by this vulnerability.

The CVSS score of CVE-2024-56171 is 7.8, indicating a high severity level.

If immediate updates are not possible, avoid processing untrusted XML documents and implement strict validation checks on XML inputs as a temporary measure.

Related vulnerabilities

Recent vulnerabilities recorded for libxml2.

How To Fix

Minimum fixed version

2.9.1+dfsg1-3ubuntu4.13+esm7

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