Code Injection Vulnerability in MongoDB Compass (CVE-2024-6376)

Bar Refael

July 8, 2024

A critical security vulnerability has been discovered in MongoDB Compass, a widely-used graphical user interface (GUI) for querying, aggregating, and analyzing MongoDB data. Identified as CVE-2024-6376, this vulnerability poses significant risks due to insufficient sandbox protection settings within the ejson shell parser used in Compass’ connection handling.

Vulnerability Details

  • CVE-2024-6376
    • Type: Code Injection Vulnerability
    • Description: Insufficient sandbox protection settings in the ejson shell parser of MongoDB Compass.
    • Impact: Allows malicious actors to execute arbitrary code on systems running affected versions of MongoDB Compass.


  • Affected Versions: MongoDB Compass versions prior to 1.42.2.
  • Severity Scores:
    • National Vulnerability Database (NVD): CVSS 9.8
    • MongoDB, Inc.: CVSS 7.0
  • Potential Consequences:
    • Data loss
    • Data corruption
    • Unauthorized access

Technical Analysis

  • Insufficient Sandbox Protection: The vulnerability arises from inadequate sandbox protection settings within the ejson shell parser, making it possible for attackers to inject and execute arbitrary code.

Mitigation and Recommendations

  1. Immediate Update:
    • Action Required: Users should update to MongoDB Compass version 1.42.2 immediately to mitigate the risk of exploitation.
    • Download Link: MongoDB Compass 1.42.2
  2. Security Audits:
    • Conduct thorough security audits on systems running affected versions to identify any signs of compromise.
  3. Access Control:
    • Implement strict access control measures to limit the potential impact of any exploitation attempts.
  4. Monitoring and Alerts:
    • Enhance monitoring to detect unusual activity that might indicate exploitation of the vulnerability.

The discovery of CVE-2024-6376 in MongoDB Compass highlights the critical need for prompt updates and vigilant security practices. Given the widespread use of MongoDB in various industries, this vulnerability poses a significant threat to data integrity and system security. Users are strongly urged to update to the latest version of MongoDB Compass to protect against potential attacks.

Stay Secure. Stay Informed.

OP Innovate Research Team.

Under Cyber Attack?

Fill out the form and we will contact you immediately.

Get OP Innovate CTI Alerts

Leave your email and get critical updates and alerts straight to your inbox