CVE-2025-6021: Libxml2: integer overflow in xmlbuildqname() leads to stack buffer overflow in libxml2
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.
Other sources
Integer Overflow (Wraparound) vulnerability in the xmlBuildQName() function in libxml2. The flaw arises due to unsafe arithmetic when concatenating XML name components using the lengths of prefix and local name. These lengths, originally sizet, are cast to int, leading to incorrect calculations when values are large. If exploited, the function can perform a memcpy with an extremely large size, causing a stack buffer overflow. This vulnerability is remotely exploitable if the attacker can influence XML content passed to affected applications, potentially resulting in denial of service.
— Red Hat
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-6021?
CVE-2025-6021 is classified as a high-severity vulnerability due to its potential to cause memory corruption and denial of service.
How do I fix CVE-2025-6021?
To fix CVE-2025-6021, it is recommended to update libxml2 to the latest version that addresses this vulnerability.
What software is affected by CVE-2025-6021?
CVE-2025-6021 affects applications that utilize the libxml2 library for XML processing.
What are the potential impacts of CVE-2025-6021?
The impacts of CVE-2025-6021 include memory corruption and potential denial of service when handling maliciously crafted input.
How can I mitigate the risks of CVE-2025-6021?
To mitigate the risks of CVE-2025-6021, ensure that all instances of libxml2 are upgraded and implement input validation to sanitize data.