Skip to main content

MongoDB Java Driver CVE-2026-118581

| EUVDEUVD-2026-112257 MEDIUM
Improper Neutralization of Special Elements in Data Query Logic (CWE-943)
2026-10-28 mongodb
6.9
CVSS 4.0 · Vendor: mongodb
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Influence raw BSON bytes via victim app
  2. Delivery
    Craft document with inconsistent self-declared length
  3. Exploit
    App wraps bytes into a database command
  4. Execution
    Database parses trailing bytes as extra command fields
  5. Impact
    Alter data read or written under app credentials

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Query language parameterization
Exploitation Conditions

The vulnerable path is reached only when the application constructs a MongoDB command from a raw BSON document (e.g., wrapping externally supplied/untrusted bytes as a raw document) and sends it as part of a command; the driver fails to check that the document's self-declared length matches the extent of the provided byte range before copying it. No authentication to the driver or database and no user interaction are required beyond the attacker's ability to influence those bytes through the application. The key limiting factor is this non-default usage pattern: applications that build commands from normal typed/validated documents rather than untrusted raw bytes are not exposed, which materially narrows real-world attack surface despite PR:N.

Impact

This is a medium-severity (CVSS 4.0 base 6.9, MongoDB-reported) NoSQL command-injection flaw (CWE-943) in the BSON encoding path of the MongoDB Java Driver. The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N) indicates network reach, low complexity, no authentication to the driver/database and no user interaction, with low confidentiality and low integrity impact and no availability impact - consistent with the description's 'unintended modification of the command actually executed, altering data read or written.' The vuln.today priority is 'this_month' rather than act_now/emergency. No EPSS score, no CISA KEV listing, and no public exploit were supplied; the only reference is the MongoDB 5.14.0 release notes. The practical caveat the raw CVSS does not capture: exploitation is gated on an application-side coding pattern - the victim app must wrap untrusted raw bytes in a raw BSON document and submit it as part of a command - so despite PR:N at the driver level, real-world exposure is narrower than a generic network-unauthenticated flaw. Net: a legitimate issue to patch on a normal cycle, not an emergency, with real risk concentrated in applications that handle untrusted raw BSON.

Exploit ScenarioDerived

An attacker supplies crafted raw bytes to an application that wraps them in a raw BSON document and submits it as part of a MongoDB command. Because the driver does not verify the document's self-declared length against the actual byte range before copying it, the database parses attacker-controlled trailing content as additional command fields, altering the query executed under the application's credentials. No public exploit identified at time of analysis.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 28, 2026

Command injection in the BSON encoding path of the MongoDB Java Driver lets an application that wraps externally supplied, untrusted bytes in a raw BSON document emit a structurally inconsistent command, so the database can interpret attacker-supplied trailing content as additional fields of the surrounding command and alter the data read or written under the application's credentials. All versions covered by the cpe:2.3:a:mongodb:java_driver wildcard are affected, and the vendor fixed the issue in the 5.14.0 release dated October 28, 2026. Severity is medium (CVSS 4.0 base 6.9; independently assessed as CVSS:3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N): no authentication to the driver or database and no user interaction are required beyond the ability to influence those bytes, but exposure is confined to the non-default pattern of building commands from untrusted raw documents, applications using typed or validated documents are not exposed, and no public exploit has been identified at time of analysis.

RemediationAI

Upgrade to MongoDB Java Driver 5.14.0 (released October 28, 2026), which contains the fix hardening BsonBinaryReader.skipValue() size validation and array allocations (PR #1990); release notes are at https://github.com/mongodb/mongo-java-driver/releases/tag/r5.14.0. If the upgrade cannot be scheduled immediately, the effective compensating control is to remove untrusted bytes from the raw-document path: do not wrap externally supplied byte arrays in raw BSON documents that become part of an outgoing command, and instead parse, validate and re-encode such input into typed documents whose encoding the driver generates itself - this closes the exposure but requires application code changes and may mean rejecting or normalizing inputs the application previously passed through verbatim. The available references list no vendor-published configuration flag or workaround beyond the fixed release.

Affected VersionsENISA

Java Driver 5.8.0 <5.14.0

Affected Packages

euvd java_driver fix: 5.14.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

BSON is MongoDB's binary serialization format, and each document begins with a little-endian int32 declaring the document's total byte length, followed by typed elements and a terminating null byte. The Java Driver's encoding layer accepts 'raw' documents - caller-supplied byte sequences that the driver copies into an outgoing command rather than re-encoding - and the flaw is that it does not reconcile a raw document's self-declared length with the extent of the byte range actually handed to it before that range is copied. When an application wraps untrusted external bytes this way, content trailing the declared document can be absorbed by the server as additional fields of the enclosing command, a data-query-logic injection (CWE-943) that changes the semantics of the command executed under the application's credentials. The upstream fix shipped in 5.14.0 is the change titled 'Harden BsonBinaryReader.skipValue() size validation and array allocations' (PR #1990), which locates the correction in length and size validation within the binary reader. The trigger requires the application to take the raw-document route with untrusted input; the mechanism by which an application might be induced to do so is not described in the available sources, and drivers constructing commands from ordinary typed documents do not exercise this path.

Know when Java Driver gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (mongodb) PRIMARY 6.9 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
vuln.today AI 6.5 MEDIUM

No driver/database authentication or interaction needed (PR:N/UI:N) and the injected bytes reach the database over the network (AV:N/AC:L); partial read/write influence over the executed command gives C:L/I:L, A:N.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (mongodb).

CVSS VectorVendor: mongodb

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Oct 28, 2026 - 18:18 EUVD

DescriptionCVE.org

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.

Threat Intelligence Overview

Prevalence
Medium
official MongoDB Java driver, popular library but confined to Java-plus-MongoDB stacks
Data Quality
3 sources
Confidence: Low

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS N/A
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

NoSQL injection exploits databases that don't use traditional SQL syntax-like MongoDB, CouchDB, or Redis-by manipulating queries through unsanitized user input.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy