CVE-2024-6376 ejson shell parser in MongoDB Compass maybe bypassed
Attackers can execute arbitrary code via the ejson shell parser in MongoDB Compass due to insufficient sandbox protection.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2024-6376?
CVE-2024-6376 is a high-severity code injection vulnerability in MongoDB Compass, published on 1 Jul 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
MongoDB Compass may be susceptible to code injection due to insufficient sandbox protection settings with the usage of ejson shell parser in Compass' connection handling. This issue affects MongoDB Compass versions prior to version 1.42.2
Which versions are affected by CVE-2024-6376?
2 open source packages ship an affected version, including @mongodb-js/connection-form. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
@mongodb-js/connection-form npm | All versions | 1.20.1 |
@mongodb-js/connection-form npm | All versions | 1.20.1 |
Products include Mongodb Compass.
How do I fix CVE-2024-6376?
Upgrade @mongodb-js/connection-form to 1.20.1 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2024-6376 being exploited?
There is no known exploitation of CVE-2024-6376 in the wild and no public exploit code.
Other vulnerabilities in MongoDB Compass
- CVE-2026-14881 Command injection in MongoDB Compass
- CVE-2025-1755 MongoDB Compass may be susceptible to local privilege escalation in Windows
- CVE-2024-3371 Insufficient validation of external input in Compass may enable MITM attacks
- CVE-2026-9101 Prototype pollution in csv parsing
- CVE-2021-20334 Local privilege escalation in MongoDB Compass for Windows
Sources
Also known as GHSA-jxr4-4prv-mh83.