Stack-Based Buffer Overflow in libxml2: Critical Vulnerability Overview

libxml2 Updated 02 Oct 2025

Summary

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

DEBIAN-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 versions < 2.9.10+dfsg-6.7+deb11u6. Fixed in 2.9.10+dfsg-6.7+deb11u6. 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 widely-used XML parsing library that provides a range of functionalities for processing XML documents. It is known for its speed and efficiency, making it a popular choice among developers for applications that require XML handling. However, like any software, it is not immune to vulnerabilities. The recent discovery of a stack-based buffer overflow in libxml2 versions prior to 2.12.10 and 2.13.x before 2.13.6 poses a significant risk, particularly when handling untrusted documents or DTDs.

Vulnerability Detail

The vulnerability arises from a stack-based buffer overflow in the xmlSnprintfElements function located in valid.c. This flaw can be exploited when DTD validation is performed on untrusted documents or DTDs, potentially allowing an attacker to execute arbitrary code or crash the application. This vulnerability is similar to CVE-2017-9047, indicating a recurring issue in the library's handling of XML validation.

How To Fix

Minimum fixed version

2.9.10+dfsg-6.7+deb11u6

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, avoid using DTD validation on untrusted documents or DTDs until the package is updated. This can help mitigate the risk of exploitation until a proper fix is applied.

Conclusion

The stack-based buffer overflow vulnerability in libxml2 is a critical issue that requires immediate attention. By updating to the latest patched versions of the library, users can protect their applications from potential exploits. It is essential to remain vigilant and utilize tools like Vulert to monitor for vulnerabilities in open-source software.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

libxml2 is an XML parsing library that provides tools for reading, manipulating, and writing XML documents efficiently.

A stack-based buffer overflow occurs when data exceeds the buffer's allocated size on the stack, potentially leading to code execution or application crashes.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Simply upload your manifest file, like package-lock.json, to check for vulnerabilities.

If an immediate update is not possible, avoid using DTD validation on untrusted documents or DTDs as a temporary measure.

Detailed information can be found in the Debian CVE database or by visiting the Vulert website for real-time monitoring of vulnerabilities.

Related vulnerabilities

Recent vulnerabilities recorded for libxml2.

How To Fix

Minimum fixed version

2.9.10+dfsg-6.7+deb11u6

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