Integer Overflow Vulnerability in libxml2: Potential Stack-Based Buffer Overflow

libxml2 Updated 02 Oct 2025

Summary

12/06/2025
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2025-6021: A flaw was found in libxml2's xmlBuildQName function, where integer overflows in buffer size calculations can lead to a stack-based buffer overflow. Affects libxml2 versions < 2.9.10+dfsg-6.7+deb11u8. Fixed in 2.9.10+dfsg-6.7+deb11u8. 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 performance and compliance with standards. However, it is susceptible to vulnerabilities that can compromise its integrity and the applications relying on it. This specific vulnerability arises from flaws in the xmlBuildQName function, which can lead to severe consequences when handling crafted XML input.

Vulnerability Detail

A flaw was found in libxml2's xmlBuildQName function, where integer overflows in buffer size calculations can lead to a stack-based buffer overflow. This issue can result in memory corruption or a denial of service when processing crafted input. Attackers may exploit this vulnerability to execute arbitrary code or crash applications that utilize libxml2 for XML processing.

How To Fix

Minimum fixed version

2.9.10+dfsg-6.7+deb11u8

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 measure, avoid processing untrusted XML input until the package is updated. Implement input validation to ensure that only safe and expected XML data is processed.

Conclusion

The integer overflow vulnerability in libxml2's xmlBuildQName function poses significant risks, including memory corruption and denial of service. It is crucial to update to the patched versions of the library to mitigate these risks and ensure the security of applications that rely on libxml2.

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.

If your application uses libxml2 to process XML data, it may be vulnerable to memory corruption or denial of service attacks due to this flaw.

Check your installed version of libxml2 against the patched versions provided in the 'how_to_fix' section. You can also use tools like Vulert to monitor for vulnerabilities.

Vulert is a service that monitors and alerts for open-source vulnerabilities in your software using just a manifest file like package-lock.json.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

Related vulnerabilities

Recent vulnerabilities recorded for libxml2.

How To Fix

Minimum fixed version

2.9.10+dfsg-6.7+deb11u8

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