---
id: "CVE-2026-114646"
kind: "vulnerability"
aliases: ["CVE-2026-114646"]
title: "MongoDB C# Driver: unchecked BSON size lets outside input alter database commands"
severity: "medium"
cvss: 6.9
epss: 0.00263
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["csharp", "dotnet", "mongodb", "package", "self-hosted"]
not_affected_if: ["no-raw-bson-from-external-input", "typed-models-only"]
published_at: "2026-10-22T19:17:38+00:00"
first_seen_at: "2026-10-23T21:57:31+00:00"
updated_at: "2026-10-25T03:38:54+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-114646", "first_seen_at": "2026-10-23T21:57:31+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-114646", "first_seen_at": "2026-10-24T07:15:51+00:00"}]
---

# MongoDB C# Driver: unchecked BSON size lets outside input alter database commands

The MongoDB C# Driver does not check that the declared size inside a raw or lazy BSON document built from external binary data matches the real length, and it sends the data on unchanged. An unauthenticated party who can supply that binary input can insert or remove elements in the database command the application issues, leading to unauthorized changes or data disclosure bounded by the application's own database privileges.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Search the application code for `RawBsonDocument` or `LazyBsonDocument` constructed from data that comes from requests, uploads or other external input.
- Check the installed driver version with `dotnet list package` and look for `MongoDB.Driver` or `MongoDB.Bson`; compare against the fixed version in the sources (unknown).

## Fix

- Upgrade the MongoDB C# Driver (`MongoDB.Driver`, `MongoDB.Bson`) to the patched release; the exact version is unknown from the sources.
- Until patched, validate the length prefix of externally supplied BSON bytes against the buffer length before building a raw or lazy document from them.

## Timeline

- 2026-10-23T21:57:31+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-114646
- 2026-10-24T07:15:51+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2026-114646

## From the sources

A data-validation flaw exists in the BSON handling and binary serialization path of the MongoDB C# Driver. When an application constructs a raw or lazy BSON document object from externally supplied binary data, the driver does not verify that the size quantity declared inside that data matches the amount of data actually provided, and it copies the data onto the wire unchanged. An unauthenticated party who can supply binary content to such an application can thereby cause additional elements to be inserted into, or existing elements to be removed from, the database command the application issues, without needing any database credentials of their own. This can result in unauthorized modification of stored data and disclosure of data outside the intended scope of the application's request, bounded by the database privileges the application itself holds.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
