CVE-2026-106432 in PHP Driverinfo

Summary

by MITRE • 10/08/2026

The BSON encoder in the MongoDB PHP Driver converts a string length to a 32-bit value without validation. When an affected application encodes a string near 4 GiB, the allocation size can wrap while the copy operation uses the original length. The resulting heap buffer overflow can corrupt process memory or terminate the PHP process. Reaching this issue requires a non-default runtime configuration that permits multi-gigabyte values. No MongoDB server interaction is required.

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

Analysis

by VulDB Data Team • 10/08/2026

The vulnerability identified in the MongoDB PHP Driver stems from an improper handling of string length conversion within its BSON encoder component, specifically classified under CWE-190 Integer Overflow or Wraparound. The core technical flaw occurs when the driver attempts to serialize a string value into Binary JSON format for storage or transmission. During this process, the implementation converts the native string length into a 32-bit unsigned integer without performing adequate validation checks against maximum allowable limits. This design oversight creates a critical arithmetic vulnerability where input values approaching four gigabytes trigger an integer wraparound condition. Specifically, when the actual byte count exceeds the capacity of a signed or appropriately bounded 32-bit representation in certain contexts, the calculated allocation size for the buffer becomes significantly smaller than the original string length due to overflow behavior.

This discrepancy between the allocated memory and the intended copy operation leads directly to CWE-120 Buffer Overflow without bounds checking. The driver proceeds to allocate a heap buffer based on the truncated 32-bit value but subsequently attempts to copy the entire, much larger original string into this undersized allocation. This action results in a heap-based buffer overflow that writes data beyond the boundaries of the allocated memory region. Such out-of-bounds writes can corrupt adjacent heap metadata or overwrite critical process structures, leading to unpredictable behavior including application crashes, denial of service conditions where the PHP process terminates abruptly, or potentially arbitrary code execution if an attacker can precisely control the overwritten memory contents and exploit specific allocator behaviors.

The operational impact of this vulnerability is severe for applications dealing with large data payloads, although it requires a non-default runtime configuration that permits multi-gigabyte string values to be processed by the driver. This constraint means that typical web applications handling standard user inputs are unlikely to trigger the flaw unless they explicitly support or receive extremely large file uploads or database entries exceeding one gigabyte in size. Despite this prerequisite, the absence of any requirement for MongoDB server interaction indicates that the vulnerability is triggered locally within the PHP process during data serialization, making it a client-side exploitation vector rather than a remote code execution via network protocol manipulation alone. The attacker does not need to compromise the database server itself but must influence the input data processed by the vulnerable driver instance.

Mitigation strategies should focus on immediate patching of the MongoDB PHP Driver to versions that include bounds checking for string lengths prior to allocation and encoding operations. Developers utilizing this driver in environments where large file processing is necessary must ensure they are running patched releases that enforce strict limits on BSON document sizes according to industry standards such as those defined by the Open Web Application Security Project or relevant database vendor guidelines. Additionally, implementing input validation at the application layer to reject strings exceeding reasonable size thresholds can provide a defense-in-depth measure against this integer overflow vulnerability. Monitoring for unusual memory usage patterns in PHP processes may also aid in detecting potential exploitation attempts of this heap corruption flaw before it leads to full system compromise.

Responsible

Mongodb

Reservation

10/06/2026

Disclosure

10/08/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!