GHSA-97mg-3cr6-3x4c
critical
Remote Code Execution in mongodb-query-parser
- Severity
- critical rating by GitHub
- Published
- Last changed
Description
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:
'(function () { return (clearImmediate.constructor("return process;")()).mainModule.require("child_process").execSync("touch test-file").toString()})()'
Recommendation
Upgrade to version 2.0.0 or later.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| mongodb-query-parser (npm) | before 2.0.0 | GitHub Advisory Database |
References
Sources
| Source | Record | Licence |
|---|---|---|
| GitHub Advisory Database | GHSA-97mg-3cr6-3x4c changed 2020-08-31 | CC-BY-4.0 |