CVE-2026-137075 in libxml2
Summary
by MITRE • 11/25/2026
GNOME libxml2 2.14.0 through 2.15.4 contains a missing NUL termination flaw in xmlBufferAddHead() in buf.c that leaves uninitialized heap bytes as the terminator for storage-less buffers. Attackers supplying data to applications reusing an xmlBuffer can trigger over-reads via xmlBufferCat() and xmlStrlen(), disclosing adjacent heap memory or causing crashes.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/25/2026
The vulnerability identified within GNOME libxml2 versions 2.14.0 through 2.15.4 represents a critical memory management flaw located in the xmlBufferAddHead function found in buf.c. This specific defect is classified as CWE-787: Out-of-bounds Read, which occurs when software reads data outside of the intended buffer boundary. The root cause lies in the handling of storage-less buffers during initialization or reuse operations. When an application reuses an existing xmlBuffer structure without properly resetting its internal state, the library fails to ensure that the end of the buffer is terminated with a null character (NUL). This omission leaves uninitialized heap bytes as the terminator for these specific buffer instances, creating a scenario where subsequent string manipulation functions operate on undefined memory regions.
The operational impact of this flaw manifests when an attacker supplies crafted data to applications that utilize libxml2 and reuse xmlBuffer objects. The lack of proper NUL termination triggers over-read conditions in downstream functions such as xmlBufferCat and xmlStrlen. These functions rely on the presence of a null terminator to determine string length or concatenation boundaries. Without this marker, they continue reading memory until they encounter an arbitrary zero byte elsewhere in the heap space. This behavior allows for the disclosure of adjacent heap memory contents, which may contain sensitive information such as credentials, encryption keys, or internal application state data. Furthermore, if the uninitialized bytes do not align with valid memory pages or trigger a protection fault during access, the result is a denial of service via application crash.
From a threat intelligence perspective, this vulnerability maps to ATT&CK technique T1083: File and Directory Discovery, as an attacker could potentially enumerate sensitive data stored in heap memory adjacent to vulnerable buffers. It also aligns with CWE-94: Improper Control of Generation of Code (Code Injection) indirectly if the leaked information facilitates further exploitation chains, though the primary vector is information disclosure and stability degradation. The flaw highlights a common pitfall in C-based libraries where manual memory management requires rigorous attention to string termination rules across all code paths, particularly those involving buffer reuse or dynamic resizing operations.
Mitigation strategies for this vulnerability require immediate patching of libxml2 to version 2.15.5 or later, which addresses the missing NUL termination logic in xmlBufferAddHead. Application developers relying on older versions should implement defensive coding practices by explicitly ensuring that all buffers are zero-initialized before reuse and validating string lengths prior to passing them to library functions. Static analysis tools configured with rules for CWE-787 can help identify similar patterns in custom codebases, while runtime protection mechanisms such as Address Sanitizer (ASan) during testing phases can expose these out-of-bounds reads before deployment. Organizations should prioritize updating their XML parsing dependencies to eliminate the risk of heap-based information disclosure and service disruption caused by this specific implementation error.