---
id: "CVE-2026-114647"
kind: "vulnerability"
aliases: ["CVE-2026-114647"]
title: "MongoDB C# Driver: FindOneAndReplace accepts $-prefixed field names, altering documents"
severity: "medium"
cvss: 5.3
epss: 0.00259
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["csharp", "dotnet", "mongodb", "package"]
not_affected_if: ["fixed-document-shape", "no-user-controlled-keys"]
published_at: "2026-10-22T19:17:38+00:00"
first_seen_at: "2026-10-23T21:57:31+00:00"
updated_at: "2026-10-25T04:19:05+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-114647", "first_seen_at": "2026-10-23T21:57:31+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-114647", "first_seen_at": "2026-10-24T07:15:51+00:00"}]
---

# MongoDB C# Driver: FindOneAndReplace accepts $-prefixed field names, altering documents

The MongoDB C# Driver's FindOneAndReplace does not reject replacement documents whose top-level field names start with a dollar sign, unlike other replace operations. If the application builds such a document from user-supplied field names, the server can apply update operators instead of a full replacement, modifying the matched document in unintended ways.

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

## How to check

- Search the codebase for `FindOneAndReplace` calls that build the replacement document from user-supplied field names.
- Check the installed driver version with `dotnet list package` and look for `MongoDB.Driver` below the fixed release.

## Fix

- Upgrade the `MongoDB.Driver` NuGet package to a patched version (unknown exact version; the sources do not say).
- Do not pass user-supplied field names as top-level keys of replacement documents; validate or reject keys starting with `$`.

## Timeline

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

## From the sources

The MongoDB C# Driver does not reject replacement documents whose top-level field names begin with a dollar sign in FindOneAndReplace, unlike other replace operations. An application that builds such a document from user-supplied field names can have the server apply update operators instead of a full replacement. The effect is limited to the document matched by the application's own filter, whose contents can be modified in ways the application did not intend.

---

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