CVE-2026-135133 in PHP Driverinfo

Summary

by MITRE • 11/25/2026

An invalid memory release in the MongoDB PHP Driver extension occurs when certain string-typed options or type-mapping settings are given non-string values. A party who can run PHP code in a process that loads the extension may corrupt process memory. This can lead to reading or changing process memory, running commands as the PHP process user, or crashing the process.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 11/25/2026

The vulnerability identified involves an invalid memory release within the MongoDB PHP Driver extension, specifically triggered by improper handling of type-mapping settings and string-typed options that receive non-string values. This flaw represents a critical failure in input validation and resource management logic embedded within the driver's C codebase. When developers configure connection strings or database operations using configuration arrays, they may inadvertently pass integer, boolean, or null values to parameters explicitly designed to accept only string data types. The extension fails to coerce these inputs into their expected string format or reject them with a safe error message. Instead, it proceeds to process the malformed input through internal memory management routines that expect valid string structures. This mismatch leads to an attempt to free memory blocks using incorrect pointers or sizes, resulting in heap corruption and undefined behavior within the PHP runtime environment.

From a technical perspective, this issue is classified under CWE-416, which describes Use After Free vulnerabilities, although it manifests here as an invalid free operation that corrupts the process's memory state rather than strictly accessing freed memory after release. The root cause lies in the lack of rigorous type checking during the initialization phase of MongoDB client objects or cursor configurations. In PHP extensions written in C, string variables are represented by specific structures containing length and value pointers. When a non-string variable is passed where a zval representing a string is expected, the internal conversion mechanisms may fail to allocate new memory correctly or may reference invalid offsets. Consequently, when the garbage collector or explicit cleanup routines attempt to release these resources, they interact with corrupted heap metadata. This can lead to double-free conditions, buffer overflows during subsequent allocations, or arbitrary write primitives if an attacker can control the malformed input sufficiently to influence pointer arithmetic.

The operational impact of this vulnerability is severe due to its potential for remote code execution and denial of service within the context of the web server process. Since PHP typically runs under a specific system user account associated with the web application, compromising memory integrity allows an adversary to read sensitive data stored in that process's address space, such as database credentials, session tokens, or internal application logic. More critically, heap corruption techniques can be leveraged to achieve arbitrary code execution by overwriting function pointers or return addresses on the stack. This effectively grants the attacker the ability to run commands with the privileges of the PHP process user, which often has access to local files and network resources. Additionally, even without successful exploitation for code execution, the memory corruption inevitably leads to segmentation faults and crashes, causing a denial of service that disrupts availability for legitimate users.

This vulnerability aligns with MITRE ATT&CK technique T1059, Command and Scripting Interpreter, as it provides an initial foothold via PHP script injection or misconfiguration that can be escalated into system-level control. It also relates to CWE-20, Improper Input Validation, highlighting the necessity for strict type enforcement in extension development. To mitigate this risk, developers should ensure they are using the latest version of the MongoDB PHP Driver where these input validation checks have been hardened. Application code must strictly enforce data types before passing configuration options to the driver, utilizing explicit casting or validation libraries to guarantee that all string parameters contain valid strings. Furthermore, enabling strict error reporting and monitoring for segmentation faults in production environments can help detect exploitation attempts early. System administrators should also apply principle of least privilege by ensuring the PHP process runs with minimal permissions, limiting the blast radius if memory corruption is successfully exploited.

Responsible

Mongodb

Reservation

11/23/2026

Disclosure

11/25/2026

Moderation

accepted

CPE

ready

EPSS

0.00280

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!