Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-106436 Overview
The MongoDB PHP Driver contains an unchecked return value flaw [CWE-252] in its Binary JSON (BSON) encoder. When a document exceeds the size limit enforced by libbson, the encoder fails to validate some return values and continues operating in an invalid state. An unauthenticated remote attacker who can submit an unusually large data structure to an affected application can crash the PHP worker process or cause the encoded document to silently omit fields. No MongoDB server connection or database authentication is required to trigger the condition.
Critical Impact
Remote unauthenticated attackers can terminate PHP workers or produce malformed BSON documents with missing fields by submitting oversized data structures.
Affected Products
- MongoDB PHP Driver (mongodb/php_driver)
- PHP applications using the MongoDB extension for BSON encoding
- Web services that accept user-controlled data and serialize it to BSON
Discovery Timeline
- 2026-10-08 - CVE-2026-106436 published to NVD
- 2026-10-13 - Last updated in NVD database
Technical Details for CVE-2026-106436
Vulnerability Analysis
The flaw resides in the BSON encoder component of the MongoDB PHP Driver. BSON is MongoDB's binary serialization format, and libbson enforces a maximum document size. When the encoder attempts to append data that pushes a document past this limit, libbson returns an error status. The driver does not consistently inspect these return values in every code path. Execution continues against buffers and state tracking that libbson already marked as invalid.
Two observable outcomes result. First, the PHP worker process can terminate, producing a denial-of-service condition against the hosting application. Second, the encoder can return a document in which fields were silently dropped. Downstream consumers then process incomplete data without any error signal, which can corrupt stored records or alter application logic.
Root Cause
The root cause is a missing check on return values from libbson append operations after the size threshold is crossed. The driver trusts that encoding succeeded and continues to serialize subsequent fields. This pattern aligns with CWE-252: Unchecked Return Value.
Attack Vector
Exploitation requires only that an attacker supply input that the application serializes into BSON. Typical triggers include large JSON bodies, deeply nested arrays, or oversized string payloads submitted through HTTP endpoints. The attack is remote, requires no authentication, and needs no interaction with the MongoDB server itself. See the MongoDB Jira Issue PHPC-2739 for vendor technical details.
Detection Methods for CVE-2026-106436
Indicators of Compromise
- Unexpected PHP-FPM or PHP worker crashes correlated with large request bodies
- MongoDB documents written with missing or truncated fields that lack corresponding application errors
- HTTP 500 responses or connection resets during endpoints that serialize user input to BSON
- Spikes in request sizes directed at endpoints that persist data to MongoDB
Detection Strategies
- Monitor PHP worker process restarts and segmentation faults in web server logs
- Compare application-level write intent against persisted document schemas to detect dropped fields
- Inspect request bodies for payload sizes approaching the 16 MB BSON document limit
- Review MongoDB extension version strings reported by phpinfo() and composer show output
Monitoring Recommendations
- Enable PHP error logging with stack traces for all production hosts running the MongoDB driver
- Alert on repeated worker termination events from the same client IP or user agent
- Instrument BSON encoding paths with size and field-count telemetry
How to Mitigate CVE-2026-106436
Immediate Actions Required
- Inventory all PHP applications using the mongodb/mongodb library and the underlying MongoDB PHP extension
- Upgrade to the patched release of the MongoDB PHP Driver referenced in MongoDB Jira PHPC-2739
- Enforce request body size limits at the web server and application framework layer
- Validate and reject input structures that exceed documented application thresholds before BSON encoding
Patch Information
MongoDB tracks the fix under Jira issue PHPC-2739. Administrators should apply the vendor-released driver update and redeploy affected PHP workers. Confirm the installed extension version matches or exceeds the patched build after upgrade.
Workarounds
- Cap incoming request body sizes using client_max_body_size in nginx or LimitRequestBody in Apache
- Add schema validation to reject documents that approach the 16 MB BSON limit before encoding
- Wrap BSON encode calls in try-catch blocks and verify the resulting document contains all expected fields
# Configuration example: upgrade the MongoDB PHP extension and enforce request limits
pecl upgrade mongodb
# nginx request size cap to reduce exposure
# /etc/nginx/nginx.conf
# http { client_max_body_size 1m; }
# Verify installed driver version
php --ri mongodb | grep -i version
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

