Skip to main content
Vulnerability Database/CVE-2026-113870

CVE-2026-113870: MongoDB Compass RCE Vulnerability

CVE-2026-113870 is a remote code execution vulnerability in MongoDB Compass that allows attackers to execute arbitrary code when users edit specially crafted views. This article covers technical details, impact analysis, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-113870 Overview

CVE-2026-113870 is an improper output neutralization vulnerability [CWE-116] in MongoDB Compass. The flaw exists in how Compass converts a stored view's aggregation pipeline into editable source. Specific Binary JSON (BSON) values are not escaped correctly during this conversion. When a user connects to a MongoDB deployment and opens a specially crafted view for editing, embedded payloads can execute arbitrary code with the privileges of the user running Compass.

Critical Impact

Opening a malicious view in MongoDB Compass can trigger arbitrary code execution on the operator's workstation, compromising administrator credentials and local data.

Affected Products

  • MongoDB Compass (versions prior to 1.49.15)
  • MongoDB Compass Readonly and Isolated editions sharing the same editor code paths
  • Any environment where administrators open views on untrusted MongoDB deployments

Discovery Timeline

  • 2026-10-21 - CVE-2026-113870 published to the National Vulnerability Database (NVD)
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-113870

Vulnerability Analysis

MongoDB Compass is the graphical client used by developers and database administrators to inspect MongoDB deployments. When a user opens a stored view, Compass reconstructs the view's aggregation pipeline into an editable text representation inside the UI. The conversion routine does not consistently escape BSON values that contain characters with special meaning in the target source context.

An attacker who can create or modify a view on a MongoDB deployment can embed crafted BSON values. When a Compass user later opens the view for editing, the unescaped values break out of their intended string context. The injected payload runs inside the Compass renderer process, which is built on Electron and executes JavaScript with the privileges of the local user.

Exploitation requires user interaction: the victim must connect to the attacker-controlled or compromised deployment and open the malicious view. However, no authentication to the victim's workstation is needed, and attack complexity is low.

Root Cause

The root cause is improper encoding or escaping of output [CWE-116]. The pipeline-to-source conversion treats BSON string content as safe when regenerating editor text, allowing control characters and quote boundaries inside BSON values to alter the surrounding syntactic structure.

Attack Vector

The attack vector is network-adjacent through MongoDB. An attacker with write access to a database creates a view whose aggregation stages contain crafted BSON payloads. The attacker then convinces a Compass user to connect and open that view. Supply-chain scenarios include shared development clusters, managed service instances with weak isolation, and honeypot deployments presented to targeted administrators.

No verified exploit code is available in public sources. See the MongoDB Compass Release Notes for vendor details.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-113870

Indicators of Compromise

  • Compass processes spawning unexpected child processes such as cmd.exe, powershell.exe, /bin/sh, or osascript shortly after opening a view
  • Outbound network connections from the Compass process to non-MongoDB endpoints
  • Creation or modification of views containing unusually long string literals, escape sequences, or embedded quote characters in aggregation stages
  • New files written to the user profile directory immediately after a Compass editor session

Detection Strategies

  • Hunt for Compass child-process trees that deviate from normal usage patterns on developer and DBA workstations
  • Query MongoDB system.views collections across managed clusters for aggregation pipelines containing suspicious BSON string content
  • Correlate Compass application telemetry with endpoint process creation events to catch post-exploitation activity

Monitoring Recommendations

  • Enable MongoDB audit logging for createCollection and collMod operations that define or modify views
  • Alert on Compass processes initiating connections to hosts other than approved MongoDB endpoints
  • Monitor for persistence artifacts created in user profile locations after Compass sessions

How to Mitigate CVE-2026-113870

Immediate Actions Required

  • Upgrade MongoDB Compass to version 1.49.15 or later on all workstations
  • Instruct administrators to avoid opening views on untrusted or shared MongoDB deployments until patched
  • Inventory existing views across production clusters and review any created by non-administrative accounts
  • Restrict createCollection and view-modification privileges to trusted service and administrator accounts

Patch Information

MongoDB released a fix in Compass 1.49.15. Review the MongoDB Compass Release Notes for upgrade instructions and the full list of resolved issues. Distribute the updated client through managed software deployment to ensure all users receive the fix.

Workarounds

  • Use the mongosh command-line client to inspect suspicious views instead of opening them in Compass
  • Apply role-based access control to prevent untrusted principals from creating or modifying views
  • Run Compass under a dedicated low-privilege user account to limit the impact of code execution
bash
# Verify installed Compass version on macOS and Linux
mongodb-compass --version

# Revoke view creation from a role in mongosh
use admin
db.revokeRolesFromUser("appUser", [{ role: "readWrite", db: "reports" }])

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.