Stack-Based Buffer Overflow in libxml2: CVE-2025-24928

libxml2 Updated 02 Oct 2025

Summary

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

CVE-2025-24928: libxml2 before 2.12.10 and 2.13.x before 2.13.6 has a stack-based buffer overflow in xmlSnprintfElements in valid.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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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, making it a critical component in many applications. However, certain versions of libxml2 are vulnerable to a stack-based buffer overflow, which can occur during DTD validation of untrusted documents or DTDs.

Vulnerability Detail

CVE-2025-24928 is a stack-based buffer overflow vulnerability found in libxml2 versions prior to 2.12.10 and 2.13.x before 2.13.6. This vulnerability arises in the xmlSnprintfElements function within valid.c. If an attacker provides an untrusted XML document or DTD, they could exploit this vulnerability to execute arbitrary code, leading to potential data breaches or system compromise. This issue is reminiscent of CVE-2017-9047, indicating a recurring problem in the library's handling of XML validation.

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 using DTD validation for untrusted XML documents. This can be done by disabling DTD processing in your XML parser settings, if applicable.

Conclusion

CVE-2025-24928 represents a significant security risk for applications using vulnerable versions of libxml2. It is crucial for users to update their libraries to the latest secure versions to protect against potential exploits. Additionally, employing workarounds can help mitigate risks until updates are applied.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

CVE-2025-24928 is a vulnerability in libxml2 that allows for a stack-based buffer overflow during DTD validation of untrusted documents.

libxml2 versions before 2.12.10 and 2.13.x before 2.13.6 are affected by this vulnerability.

Exploitation of this vulnerability can lead to arbitrary code execution, potentially compromising the system and exposing sensitive data.

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

If immediate updates are not possible, disable DTD validation for untrusted documents as a temporary measure to mitigate the risk.

Related vulnerabilities

Recent vulnerabilities recorded for libxml2.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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