CVE-2026-106432

Heap buffer overflow via 32-bit string-length truncation in MongoDB PHP Driver

Published Oct 8, 2026 CVSS 4.0 · 2 Low EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The BSON encoder in the MongoDB PHP Driver converts string lengths to a 32‑bit value without validation. When an application encodes a string near 4 GiB, the allocated buffer size can wrap while the copy still uses the original large length. This heap buffer overflow can corrupt process memory or terminate the PHP process. Reaching the issue requires a non‑default runtime configuration that permits multi‑gigabyte strings; no interaction with the MongoDB server is required.

Affected Systems

MongoDB PHP Driver is the affected product. All installations that include the unpatched BSON encoder are vulnerable, regardless of specific version. The flaw exists only within the driver; MongoDB server interaction is not needed.

Risk and Exploitability

The CVSS score of 2 indicates a low severity. EPSS is not available and the vulnerability is not listed in CISA’s KEV catalog. Exploitation requires a runtime configuration that allows strings close to the 4‑GiB boundary; the default configuration typically mitigates this scenario. If an attacker can supply large strings to a PHP application using the driver, they could trigger an overflow, potentially corrupting memory or causing a crash, but the flaw does not provide code execution or persistence. Therefore, the risk is low under typical configurations, though it could be higher in environments accepting large payloads without validation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the MongoDB PHP Driver to the latest version that contains the fix for the BSON encoding overflow.
  • Configure the PHP runtime or application server to disallow or reject strings that approach the 4 GiB boundary, for example by setting appropriate length limits in php.ini or within the application logic.
  • Implement validation checks in the application layer to ensure that any string passed to the driver is within a safe, small size before encoding.

Generated by OpenCVE AI on October 9, 2026 at 14:10 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:mongodb:php_driver:*:*:*:*:*:mongodb:*:*
Type Values Removed Values Added
First Time appeared Mongodb
Mongodb php Driver
Vendors & Products Mongodb
Mongodb php Driver
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description 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.
Title Heap buffer overflow via 32-bit string-length truncation in MongoDB PHP Driver
Weaknesses CWE-681
References
Metrics cvssV3_1

{'score': 3.6, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L'}

cvssV4_0

{'score': 2, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-681

    Incorrect Conversion between Numeric Types

  • CWE-787

    Out-of-bounds Write

Sources

Status
PUBLISHED
Assigner
mongodb
Published
Updated
Oct 8, 2026, 7:51 PM
Reserved
Oct 6, 2026, 4:40 PM
Status
Analyzed
Published
Oct 8, 2026, 8:17 PM
Modified
Oct 13, 2026, 8:09 PM
Severity
Low
Public date
Oct 8, 2026, 7:02 PM