Use-After-Free Vulnerability in libxml2: Critical XML Schema Processing Flaw

libxml2 Updated 02 Oct 2025

Summary

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

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 across 2 version ranges.

< 2.11.8-r1 >= 4b637079f26d8f5879ed45eb18cd249cad261951, < 02d577715e1951cf114ca4e9adaf5605156c4f4c

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 Devnack Penetration testing for web, API and mobile 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 open-source library for parsing XML documents. It provides a range of functionalities including validation of XML against schemas, XPath support, and more. The library is integral to many applications that rely on XML data processing. However, certain versions of libxml2 are vulnerable to a use-after-free condition, which can lead to potential exploitation if an attacker crafts a malicious XML document or schema.

Vulnerability Detail

The vulnerability, identified as CVE-2024-56171, exists in 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 the xmlschemas.c file. This flaw can be exploited by validating a specially crafted XML document against an XML schema that contains specific identity constraints, or by using a crafted XML schema. Successful exploitation may lead to application crashes or arbitrary code execution, posing significant risks to affected systems.

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

As a temporary workaround, avoid processing untrusted XML documents or schemas until the library is updated to a secure version. Additionally, consider implementing input validation to filter out potentially malicious content.

Conclusion

CVE-2024-56171 represents a significant risk for applications using vulnerable versions of libxml2. It is crucial for users to update their libraries promptly to mitigate potential exploitation. By following the recommended steps for updating and implementing workarounds, users can protect their systems from this vulnerability.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

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

libxml2 versions before 2.12.10 and 2.13.x before 2.13.6 are vulnerable to this issue.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If an immediate update is not possible, avoid processing untrusted XML documents and implement input validation as a temporary measure.

More details can be found in the official CVE database or through the provided source link in the vulnerability details.

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