CVE-2026-106436 in PHP Driverinfo

Summary

by MITRE • 10/08/2026

The BSON encoder in the MongoDB PHP Driver does not check some return values after a document exceeds libbson's size limit. This can leave the encoder in an invalid state. An unauthenticated actor who can cause an affected application to encode an unusually large data structure can terminate the PHP worker or cause the resulting document to omit fields. No MongoDB server connection or database authentication is required.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 10/08/2026

The vulnerability identified within the MongoDB PHP Driver centers on a critical oversight in the BSON encoder's error handling mechanisms, specifically regarding size limit enforcement. When an application attempts to encode a data structure that exceeds the maximum document size defined by libbson, the underlying C library returns an error code indicating failure. However, the PHP extension fails to adequately check these return values before proceeding with subsequent operations or returning control to the PHP runtime environment. This lack of validation leaves the encoder in an undefined and invalid state, potentially causing memory corruption or logical inconsistencies within the driver's internal structures. The flaw is particularly insidious because it does not require any interaction with a MongoDB server instance; the damage occurs entirely during the local serialization process on the web server or application host.

From an operational perspective, this vulnerability allows for two distinct types of impact depending on how the affected PHP worker handles the invalid state. In many configurations, encountering such an internal error leads to a segmentation fault or similar critical failure, resulting in the immediate termination of the PHP-FPM worker process. This effectively creates a Denial of Service condition where any request triggering this oversized encoding will crash the backend service handling that specific thread, requiring manual intervention or automatic restart mechanisms to restore functionality. Alternatively, if the error is silently ignored by higher-level application logic, the resulting BSON document may be truncated or have fields omitted entirely. This data integrity issue can lead to silent failures in applications that rely on complete documents for business logic execution, potentially causing incorrect calculations, missing records, or inconsistent database states without raising immediate alarms.

The attack vector for this vulnerability is straightforward and does not require authentication. An unauthenticated actor who has the ability to submit HTTP requests containing large data payloads can trigger the encoding process within the PHP application. Since no MongoDB server connection or database credentials are needed to exploit this flaw, the risk surface includes any public-facing web application that uses the MongoDB PHP Driver for local document preparation before insertion. This is common in many modern architectures where documents are constructed and validated locally before being sent to the database. The attacker simply needs to craft a request with a payload large enough to exceed libbson's size limit, thereby forcing the encoder into its invalid state.

This vulnerability aligns with CWE-252, which describes unchecked return values as a common cause of software weaknesses. By failing to verify that critical functions like BSON encoding have completed successfully, the driver violates fundamental principles of defensive programming and error handling integrity. Furthermore, from an offensive security perspective, this behavior can be categorized under MITRE ATT&CK technique T1496, Resource Hijacking, specifically in the context of Denial of Service through resource exhaustion or process termination. The lack of proper input validation regarding document size contributes to a broader class of issues where applications assume successful execution without verifying system constraints.

Mitigation strategies should focus on both immediate patching and architectural improvements. Organizations using affected versions of the MongoDB PHP Driver must upgrade to a patched version that properly checks return values from libbson functions and handles encoding errors gracefully, either by throwing an exception or returning a clear error code to the application layer rather than leaving the encoder in an invalid state. Additionally, developers should implement strict input validation at the application level before attempting BSON serialization. This includes enforcing maximum payload sizes based on MongoDB's 16MB document limit plus any overhead required for encoding, ensuring that oversized requests are rejected early with a meaningful HTTP error response such as 400 Bad Request or 413 Payload Too Large. Implementing these controls prevents the driver from ever encountering conditions that trigger this internal failure mode, thereby preserving service availability and data integrity.

Responsible

Mongodb

Reservation

10/06/2026

Disclosure

10/08/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!