CVE-2026-86138 in libxml2info

Summary

by MITRE • 09/05/2026

In libxml2 before 2.15.4, xmlDictAddQString in dict.c has an integer overflow and resultant heap-based buffer overflow.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 09/05/2026

The vulnerability identified in versions of the libxml2 library prior to release 2.15.4 centers on a critical memory safety flaw within the dictionary management subsystem, specifically located in the xmlDictAddQString function found in dict.c. This component is responsible for managing string deduplication and storage within XML parsing contexts, a process that involves allocating heap memory based on calculated sizes derived from input data lengths. The core technical defect arises when the library calculates the required buffer size to store a new string entry or update an existing one. Due to insufficient validation of arithmetic operations during this calculation phase, an integer overflow occurs. This mathematical error results in a significantly smaller allocated buffer than what is actually needed to hold the incoming string data, creating a classic heap-based buffer overflow condition when subsequent write operations attempt to populate the undersized memory region with the full content of the input string.

From a technical perspective, this flaw represents a failure in boundary checking and type safety during dynamic memory allocation. When an attacker provides crafted XML input containing strings with specific length characteristics or encoding patterns that trigger the arithmetic overflow, the resulting heap corruption can lead to arbitrary code execution if the overwritten memory contains function pointers or control data used by the parser engine. Alternatively, it may cause a denial of service through application crashes due to segmentation faults triggered by accessing invalid memory addresses. The vulnerability is particularly dangerous because libxml2 is widely embedded in numerous web browsers, document processing tools, and server-side applications that parse XML data from untrusted sources, thereby expanding the potential attack surface significantly across diverse software ecosystems.

The operational impact of this vulnerability extends beyond simple application instability. In environments where libxml2 processes user-supplied or network-received XML documents, such as in web services handling SOAP messages, configuration file parsers, or document conversion pipelines, exploitation could allow remote attackers to execute arbitrary code with the privileges of the affected process. This aligns with common weakness enumeration standards that classify heap-based buffer overflows under CWE-120 and integer overflow issues under CWE-190. The lack of proper bounds checking in the dictionary addition routine means that even seemingly benign XML structures can be weaponized to corrupt memory, potentially leading to information disclosure if sensitive data resides adjacent to the allocated buffers or facilitating further exploitation chains involving heap spraying techniques.

Mitigation strategies primarily involve upgrading to libxml2 version 2.15.4 or later, where developers have implemented rigorous checks for integer overflows and added proper boundary validations before buffer allocation. For organizations unable to immediately patch their systems, defensive coding practices such as input validation at the application layer can help filter out excessively long strings or malformed XML structures that might trigger the overflow condition. Additionally, enabling compiler-based security features like stack protectors and heap hardening mechanisms may reduce the likelihood of successful exploitation by making memory corruption more difficult to leverage for code execution. Security teams should also monitor ATT&CK techniques related to initial access and privilege escalation via buffer overflows, ensuring that intrusion detection systems are tuned to detect anomalous memory allocation patterns or crashes associated with XML parsing modules within their infrastructure.

Responsible

MITRE

Reservation

09/05/2026

Disclosure

09/05/2026

Moderation

accepted

CPE

ready

EPSS

0.00120

KEV

no

Activities

low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!