---
id: CVE-2026-93395
title: >-
  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
summary: >-
  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 doe…
severity: medium
cvss: 5.3
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L'
cwe:
  - CWE-191
vendor: MongoDB Inc.
product: C Driver
affected:
  - c_driver >= 2.0.0 < 2.3.1
published: '2026-09-17'
updated: '2026-09-18'
sourceUpdated: '2026-09-18T19:05:01.127'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-93395'
references:
  - url: 'https://jira.mongodb.org/browse/CDRIVER-6343'
    label: cna@mongodb.com
tags:
  - nvd
  - cve.org
epss: 0.00238
epssPercentile: 0.15065
ssvc:
  exploitation: none
  automatable: 'yes'
  technicalImpact: partial
  timestamp: '2026-09-18T14:27:39.885031Z'
ingestedAt: '2026-09-17T21:29:16.992Z'
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
