CVE-2026-118581: NoSQL injection via mismatched BSON size prefix in raw document splice to the wire protocol

Published Oct 28, 2026
·
Updated

A BSON encoding component of the MongoDB Java Driver does not verify that an externally supplied raw document's self-declared length agrees with the extent of the byte range it is given before that range is copied into an outgoing database command. An application that wraps untrusted raw bytes in such a document and uses it as part of a command can therefore emit a structurally inconsistent message, causing the database to interpret attacker-supplied trailing content as additional fields of the surrounding command. No authentication to the driver or database is required beyond the ability to influence those bytes through the victim application, and no user interaction is needed. The result is unintended modification of the command actually executed, which can alter the data read or written under the application's credentials.

Affected Software

1 affected component
MongoDB MongoDB Java Driver

Event History

Oct 28, 2026
CVE Published
via MITRE·04:51 PM
Data Sourced
via MITRE·04:51 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are exposed to this issue?

Applications using the MongoDB Java Driver are exposed if they place untrusted raw BSON bytes into a document that is sent as part of a database command. The issue depends on attacker-controlled bytes reaching the raw-document splice path; it is not described as affecting ordinary trusted BSON construction.

2

What does an attacker need to exploit it?

An attacker needs the ability to influence raw BSON bytes processed by a vulnerable application. They do not need authentication to the driver or database, and no user interaction is required, but the resulting command runs with the victim application's database credentials.

3

What is the likely impact of successful exploitation?

Attacker-supplied trailing content can be interpreted as additional fields in the surrounding database command. This can modify the command that executes and alter data read or written by the application.

4

How can teams assess whether they are affected?

Review application code for use of externally supplied raw BSON documents or byte ranges that are embedded into outgoing MongoDB commands. Pay particular attention to code that accepts serialized BSON from requests, messages, files, or other untrusted inputs rather than constructing BSON fields from validated application values.

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