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

- Severity: Critical (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2020-09-04T17:27:23.000Z
- Modified: 2020-08-31T18:59:39.000Z

## 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.

(As written by GitHub Advisory Database.)

## Affected

- mongodb-query-parser (npm): before 2.0.0

## References

- <https://www.npmjs.com/advisories/1448> (web)

## Sources

- GitHub Advisory Database: [GHSA-97mg-3cr6-3x4c](https://github.com/advisories/GHSA-97mg-3cr6-3x4c), CC-BY-4.0, modified 2020-08-31

---

Page: https://cve.day/GHSA-97mg-3cr6-3x4c · Whole record: https://cve.day/GHSA-97mg-3cr6-3x4c.json · Rebuilt by cve.day 2026-11-25T22:56:44.868Z
