CVE-2026-93395 PUBLISHED

Integer Underflow → Heap Out-of-Bounds Read in `bson_new_from_buffer()

Assigner: mongodb
Reserved: 17.09.2026 Published: 17.09.2026 Updated: 17.09.2026

A missing lower-bound validation in the bson_new_from_buffer() 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 UINT32_MAX, 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.

Metrics

CVSS Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
CVSS Score: 6.9

Product Status

Vendor MongoDB Inc.
Product C Driver
Versions Default: unaffected
  • affected from 2.0.0 to 2.3.1 (excl.)

References

Problem Types

  • CWE-191: Integer Underflow (Wrap or Wraparound) CWE