NoSQL injection via array replacement bypassing update shape validation in driver write path
Medium5.4CVE-2026-81528 · Published Aug 27, 2026
### Impact A MongoDB C# driver document-replacement code path omits the element-name/shape validation that the equivalent write paths apply, so a value supplied as a replacement is forwarded to the server without neutralization of query-language special elements. An application that passes untrusted, loosely-typed input as a replacement value therefore allows that input to be interpreted by the database as update logic rather than as data, executing under the application's own database credentials. Applications using strongly-typed document mappings are not affected. ### Patches From driver version 3.11.1, a replacement that is not a document is rejected with an `ArgumentException` instead of being sent to the server. ### Workarounds Make sure the replacement you pass to `ReplaceOne`, `FindOneAndReplace` or a bulk-write replace is a document, not a raw value such as an array. ### References [CSHARP-6158](https://jira.mongodb.org/browse/CSHARP-6158), [Fix](https://github.com/mongodb/mongo-csharp-driver/commit/27bc81ddeb407348fff57b3370aba360a13c5404), [CVE](https://www.cve.org/CVERecord?id=CVE-2026-81528)
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| MongoDB.Driver NuGet | >= 2.9.0, < 3.11.1 | 3.11.1 |
Details and references
- CVSS 3.1
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
- Severity from
- GitHub (reviewed advisory)
- Weakness
- CWE-943
More MongoDB advisories
All MongoDB| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Aug 27 | NoSQL injection in LINQ pipeline translation | Medium6.5 | 3.11.1 |
| Aug 27 | KMS master key exposure via unredacted credential serialization in driver settings string | Medium5.6 | 3.11.1 |
| Aug 27 | Connection-option injection via unescaped settings in the canonical MongoDB URL builder | High7.1 | 3.11.1 |
| Aug 27 | Cross-tenant database retargeting via dot/NUL injection in namespace strings in the PHP Driver | High8.1 | 1.21.4+1 more |
| Aug 27 | Cross-database write retargeting via unvalidated dotted database name in Client.BulkWrite | High7.1 | 2.8.2 |
| Aug 27 | Cross-database write redirection via unvalidated dotted database name in bulk write namespaces | Medium6.5 | 3.8.2 |