GHSA-97mg-3cr6-3x4c

Suggest an improvement
Source
https://github.com/advisories/GHSA-97mg-3cr6-3x4c
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/09/GHSA-97mg-3cr6-3x4c/GHSA-97mg-3cr6-3x4c.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-97mg-3cr6-3x4c
Published
2020-09-04T17:27:23Z
Modified
2020-08-31T18:59:39Z
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:

'(function () { return (clearImmediate.constructor("return process;")()).mainModule.require("child_process").execSync("touch test-file").toString()})()'

Recommendation

Upgrade to version 2.0.0 or later.

Database specific
{
    "cwe_ids":  [],
    "github_reviewed":  true,
    "github_reviewed_at":  "2020-08-31T18:59:39Z",
    "nvd_published_at":  null,
    "severity":  "CRITICAL"
}
References

Affected packages

npm / mongodb-query-parser

Package

Name
mongodb-query-parser
View open source insights on deps.dev
Purl
pkg:npm/mongodb-query-parser

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.0.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/09/GHSA-97mg-3cr6-3x4c/GHSA-97mg-3cr6-3x4c.json"