MongoDBGHSA-m5x2-prh6-wmcj
Stack exhaustion when decoding deeply nested BSON in MongoDB PHP Driver
Fix: upgrade to 1.21.12 or later (3 fixed versions below)
Impact
An uncontrolled recursion weakness in the BSON decoding logic of the MongoDB PHP driver may allow an unauthenticated party who can supply crafted binary document data to the decoder to exhaust the process stack. This may cause the PHP process using the driver to terminate unexpectedly, resulting in a loss of availability for that process. The condition occurs below the PHP layer and cannot be intercepted by application-level error handling.
Patches
Fixed in 1.21.12, 2.1.12, and 2.5.5.
Workarounds
Avoid decoding BSON provided by untrusted parties. There is no runtime configuration that mitigates this issue.
References
https://www.cve.org/CVERecord?id=CVE-2026-112368
https://jira.mongodb.org/browse/PHPC-276
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| mongodb Product | >= 1.0.0, < 1.21.12 | 1.21.12 |
| >= 2.0.0, < 2.1.12 | 2.1.12 | |
| >= 2.2.0, < 2.5.5 | 2.5.5 | |
| mongodb/mongodb-extension Product | >= 1.0.0, < 1.21.12 | 1.21.12 |
| >= 2.0.0, < 2.1.12 | 2.1.12 | |
| >= 2.2.0, < 2.5.5 | 2.5.5 |
Details and references
- CVSS 4.0
- CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
- Severity from
- GitHub (reviewed advisory)
- Weakness
- CWE-674