GitHub Advisoryadvisory · npm

GHSA-97mg-3cr6-3x4c Remote Code Execution in mongodb-query-parser

CRITICAL Published 2020-09-04 Modified 2020-08-31 Official page ↗
Ecosystem
npm
Packages
mongodb-query-parser
Severity
Critical
Reviewed
2020-08-31

Affected packages

• npm mongodb-query-parser: < 2.0.0 → fixed in 2.0.0

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.

References