CVE-2026-106431: One-byte heap buffer overflow in BSON bulk document writer in MongoDB C Driver
An off-by-one error in the BSON bulk document writer in the MongoDB C Driver can write one zero byte immediately past a heap allocation when a document ends at a specific buffer boundary. An actor who can influence the size of documents serialized by an embedding application can corrupt adjacent process memory or terminate the process. Reaching this issue requires the application to use the BSON bulk-writer API and produce a precise cumulative document size.
Affected Software
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications embedding the MongoDB C Driver are exposed only if they use the BSON bulk-writer API and serialize documents whose cumulative size can reach the required buffer boundary. Applications that do not use that API are not described as affected.
What does an attacker need to exploit it?
An attacker needs to be able to influence the sizes of documents serialized by the embedding application. Exploitation also requires arranging a precise cumulative document size so that a document ends at the affected buffer boundary.
What is the potential impact?
The flaw writes a single zero byte immediately past a heap allocation. This can corrupt adjacent process memory or terminate the process.