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

libxml2 Updated 02 Oct 2025

Summary

18/02/2025
N/A
Yes i
Unrated
Not published

ALPINE-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.11.8-r1. Fixed in 2.11.8-r1. 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 range of functionalities for XML document handling, including validation against schemas. It is known for its performance and compliance with XML standards. However, certain versions of libxml2 are vulnerable to a use-after-free issue, which can lead to security risks when processing crafted XML documents.

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 arises from a use-after-free condition in the functions xmlSchemaIDCFillNodeTables and xmlSchemaBubbleIDCNodeTables within xmlschemas.c. Exploiting this vulnerability requires a specially crafted XML document that is validated against an XML schema with specific identity constraints, or a crafted XML schema itself. If successfully exploited, this could lead to application crashes or arbitrary code execution, posing significant risks to the integrity and confidentiality of the system.

How To Fix

Minimum fixed version

2.11.8-r1

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

If immediate updating is not feasible, consider implementing input validation to ensure that XML documents and schemas are not crafted in a way that could exploit this vulnerability. Additionally, avoid using the affected functions until the library is updated.

Conclusion

The CVE-2024-56171 vulnerability in libxml2 poses significant risks due to a use-after-free condition that can be exploited through crafted XML documents. It is crucial to update to the patched versions to mitigate these risks. Users should also consider using tools like Vulert for ongoing monitoring of vulnerabilities in their applications.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

CVE-2024-56171 is a critical vulnerability in libxml2 that allows for a use-after-free condition, potentially leading to application crashes or arbitrary code execution.

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

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without needing to sign up.

Exploitation of this vulnerability could lead to application crashes or arbitrary code execution, compromising system integrity and data security.

Implement input validation to prevent the use of crafted XML documents and schemas that could exploit the vulnerability, and avoid using the affected functions until an update is applied.

Related vulnerabilities

Recent vulnerabilities recorded for libxml2.

How To Fix

Minimum fixed version

2.11.8-r1

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