Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsLearn about Remote Code Execution (RCE) vulnerabilities in an interactive lesson.
Start learningUpgrade mongodb-query-parser
to version 2.0.0 or higher.
mongodb-query-parser is a library for safe parsing and validation for MongoDB queries.
Affected versions of this package are vulnerable to Remote Code Execution (RCE). Does not sanitize queries from function declarations, ternary and comma syntax.
Parsing the following payload executes touch test-file
:
'(function () { return (clearImmediate.constructor("return process;")()).mainModule.require("child_process").execSync("touch test-file").toString()})()'