CVE-2026-93395: Integer Underflow → Heap Out-of-Bounds Read in `bson_new_from_buffer()
A missing lower-bound validation in the bsonnewfrombuffer() function of libbson allows an integer underflow when processing BSON data with a zero-length prefix. The function reads a 32-bit document length from the input buffer but does not verify that the value is at least 5 (the minimum valid BSON document size) before using it in an array index calculation. When the length field is zero, the expression used to check the document's null terminator wraps to UINT32MAX, causing a heap out-of-bounds read that crashes the process. An unauthorized party who can supply crafted BSON input to an application using this API can cause a denial of service.
Affected Software
Event History
Frequently Asked Questions
Which deployments are exposed to exploitation?
Applications using libbson are exposed if they pass attacker-supplied BSON data to bson_new_from_buffer(). The attacker does not need authorization, but must be able to supply crafted BSON input to the application.
What input triggers the flaw?
A BSON input whose 32-bit document-length prefix is zero triggers the underflow. The function fails to enforce the minimum valid BSON document size of 5 before using the length in its null-terminator check.
What is the expected impact of successful exploitation?
The wrapped length calculation causes a heap out-of-bounds read and crashes the process, resulting in denial of service. The provided information does not indicate confidentiality or integrity impact.