GHSA-68cj-624m-mxj3: NoSQL operator injection via unvalidated replacement document in findOneAndReplace

Published Oct 22, 2026
·
Updated

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.

Affected Software

1 affected component
MongoDB MongoDB C# Driver

Event History

Oct 22, 2026
CVE Published
via OSV·07:13 PM
Data Sourced
via OSV·07:13 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What application pattern makes this issue exploitable?

An application is exposed if it builds the replacement document passed to FindOneAndReplace from user-supplied field names without rejecting top-level names that begin with a dollar sign. A low-privileged attacker able to supply those field names could cause MongoDB update operators to be applied.

2

How broad can the resulting modification be?

The effect is limited to the document selected by the application's own FindOneAndReplace filter. The issue does not let the attacker select arbitrary documents beyond what that filter matches, but it can alter the matched document in unintended ways.

3

What can be done if updating the driver is not immediately possible?

Reject or sanitize user-controlled top-level replacement-document field names beginning with a dollar sign before calling FindOneAndReplace. Review every use of that method where replacement document keys can originate from request data or other untrusted input.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203