GHSA-97mg-3cr6-3x4c: Mongodb query parser Remote Code Execution Vulnerability
CRITICALGHSA-97mg-3cr6-3x4c is a CRITICAL remote code execution vulnerability (General Security Weakness) affecting Mongodb query parser libraries in the npm ecosystem. The issue involves remote code execution in mongodb-query-parser. Remediation is available by upgrading affected packages to version 2.0.0.
GHSA-97mg-3cr6-3x4c at a Glance
How to Fix GHSA-97mg-3cr6-3x4c
To remediate this vulnerability, upgrade all affected Mongodb query parser 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-query-parser@2.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls mongodb-query-parser
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-97mg-3cr6-3x4c, inspect your project dependencies using npm:
npm ls mongodb-query-parser
Analyze the terminal output to locate any version of Mongodb query parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0), your application is affected.
Note: The npm ls mongodb-query-parser 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 General Security Weakness. In Mongodb query parser, 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
GHSA-97mg-3cr6-3x4c Affected Mongodb query parser Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mongodb-query-parser
|
npm |
< 2.0.0
|
2.0.0
|
References
Frequently Asked Questions
What is GHSA-97mg-3cr6-3x4c?
Which Mongodb query parser versions are affected?
What version fixes GHSA-97mg-3cr6-3x4c?
Is mongodb-query-parser affected?
What CWE is associated with GHSA-97mg-3cr6-3x4c?
How can I check npm dependencies for GHSA-97mg-3cr6-3x4c?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-97mg-3cr6-3x4c",
"modified" : "2020-08-31T18:59:39Z",
"published" : "2020-09-04T17:27:23Z",
"aliases" : [ ],
"summary" : "Remote Code Execution in mongodb-query-parser",
"details" : "Versions of `mongodb-query-parser` prior to 2.0.0 are vulnerable to Remote Code Execution. The package fails to sanitize queries, allowing attackers to execute arbitrary code in the system. Parsing the following payload executes `touch test-file`: \n\n```'(function () { return (clearImmediate.constructor(\"return process;\")()).mainModule.require(\"child_process\").execSync(\"touch test-file\").toString()})()'```\n\n\n\n## Recommendation\n\nUpgrade to version 2.0.0 or later.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "mongodb-query-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/1448"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T18:59:39Z",
"nvd_published_at" : null
}
}