{"id":"GHSA-97mg-3cr6-3x4c","aliases":["GHSA-97mg-3cr6-3x4c"],"related":[],"kind":"vulnerability","state":"published","title":"Remote Code Execution in mongodb-query-parser","summary":"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`: \n\n```'(function () { return (clearImmediate.constructor(\"return process;\")()).mainModule.require(\"child_process\").execSync(\"touch test-file\").toString()})()'```\n\n\n\n## Recommendation\n\nUpgrade to version 2.0.0 or later.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"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`: \n\n```'(function () { return (clearImmediate.constructor(\"return process;\")()).mainModule.require(\"child_process\").execSync(\"touch test-file\").toString()})()'```\n\n\n\n## Recommendation\n\nUpgrade to version 2.0.0 or later.","format":"markdown","source":"ghsa"}],"published":"2020-09-04T17:27:23.000Z","modified":"2020-08-31T18:59:39.000Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"CRITICAL"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.0.0"}],"ecosystem":"npm","package":"mongodb-query-parser","purl":"pkg:npm/mongodb-query-parser","source":"ghsa"}],"references":[{"url":"https://www.npmjs.com/advisories/1448","tags":["web"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-97mg-3cr6-3x4c","url":"https://github.com/advisories/GHSA-97mg-3cr6-3x4c","licence":"CC-BY-4.0","modified":"2020-08-31T18:59:39.000Z"}],"updatedAt":"2026-11-25T22:56:44.868Z"}