Vulnerabilities in pkg:npm/@mongodb-js/connection-form
PACKAGECVE-2024-6376 is a HIGH (CVSS 7.0) ejson shell parser vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting @mongodb js/connection form libraries in the npm ecosystem. The issue involves ejson shell parser in mongodb compass maybe bypassed. Remediation is available by upgrading affected packages to version 1.20.1.
pkg:npm/@mongodb-js/connection-form
Vulnerability advisories affecting package pkg:npm/@mongodb-js/connection-form. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-jxr4-4prv-mh83 | CVE-2024-6376 | HIGH | ejson shell parser in MongoDB Compass maybe bypassed |
CVE-2024-6376 at a Glance
Security Impact
CVSS: 7.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2024-6376
To remediate this vulnerability, upgrade all affected @mongodb js/connection form dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @mongodb-js/connection-form@1.20.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @mongodb-js/connection-form
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-6376, inspect your project dependencies using npm:
npm ls @mongodb-js/connection-form
Analyze the terminal output to locate any version of @mongodb js/connection form in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.20.1), your application is affected.
Note: The npm ls @mongodb-js/connection-form command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In @mongodb js/connection form, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-6376 Affected @mongodb js/connection form Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@mongodb-js/connection-form
|
npm |
< 1.20.1
|
1.20.1
|
References
Frequently Asked Questions
What is CVE-2024-6376?
Which @mongodb js/connection form versions are affected?
What version fixes CVE-2024-6376?
Is @mongodb-js/connection-form affected?
What is the CVSS score of CVE-2024-6376?
What CWE is associated with CVE-2024-6376?
How can I check npm dependencies for CVE-2024-6376?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jxr4-4prv-mh83",
"modified" : "2025-02-27T20:59:12Z",
"published" : "2024-07-01T15:32:47Z",
"aliases" : [ "CVE-2024-6376" ],
"summary" : "ejson shell parser in MongoDB Compass maybe bypassed",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@mongodb-js/connection-form"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.20.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-6376"
}, {
"type" : "WEB",
"url" : "https://github.com/mongodb-js/compass/commit/b1f8050d49d66be3bc499cb317a1e1de45390e51"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mongodb-js/compass"
}, {
"type" : "WEB",
"url" : "https://jira.mongodb.org/browse/COMPASS-7496"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-02-27T20:59:11Z",
"nvd_published_at" : "2024-07-01T15:15:17Z"
}
}