Skip to content

Remote Code Execution in mongodb-query-parser

Critical severity GitHub Reviewed Published Sep 4, 2020 to the GitHub Advisory Database • Updated Jan 9, 2023

Package

npm mongodb-query-parser (npm)

Affected versions

< 2.0.0

Patched versions

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

Reviewed Aug 31, 2020
Published to the GitHub Advisory Database Sep 4, 2020
Last updated Jan 9, 2023

Severity

Critical

EPSS score

Weaknesses

No CWEs

CVE ID

No known CVE

GHSA ID

GHSA-97mg-3cr6-3x4c

Source code

No known source code
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.