vm2 CVE-2026-44008
CRITICALAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconSubmit malicious JS to vm2 sandbox
-
DeliveryDefine Array.prototype[0] setter
-
ExploitTrigger Buffer allocation invoking setter
-
InstallAccess host Buffer.prototype.inspect via cross-realm leak
-
C2Chain through constructor.constructor to host Function
-
ExecuteExecute process.mainModule.require('child_process')
-
ImpactRun arbitrary system commands
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Resource sphere isolation
MITRE ATT&CK
1 technique across 1 tactic: Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires that the target application uses vm2 package version 3.11.1 or earlier AND accepts attacker-controlled JavaScript code for execution inside the vm2 sandbox. The vulnerability is exploitable against default vm2 configurations with no special features or settings required - the flaw is in the core neutralizeArraySpeciesBatch isolation mechanism. Exploitation is limited by the application's trust boundary: if the application only executes internally-authored scripts via vm2 (not user-supplied code), the vulnerability is not exploitable through external attackers. However, any scenario where untrusted code reaches vm.run() enables remote unauthenticated code execution against the host system. CVSS vector AV:N/AC:L/PR:N/UI:N reflects that no user interaction, authentication, or complex setup is needed once attacker-controlled code enters the sandbox - the POC demonstrates exploitation in under 10 lines with no advanced techniques required. |
| Impact | CVSS 9.8 (AV:N/AC:L/PR:N/UI:N) reflects the technical severity but requires context to assess real-world priority. The 'network vector' rating assumes vm2 is deployed in a network-facing service that accepts untrusted code (e.g., online code playgrounds, serverless function platforms, educational coding tools). In such deployments, this is a critical complete-compromise vulnerability. However, exploitation prerequisites are specific: the application must (1) use vm2 ≤3.11.1, (2) execute attacker-controlled JavaScript code within the sandbox, and (3) grant that code control over what gets executed (not just data processing). The publicly available POC (from GitHub Security Advisory GHSA-9qj6-qjgg-37qq) demonstrates trivial exploitation - the code is 9 lines and requires no special techniques beyond basic JavaScript knowledge. EPSS and KEV data not provided, but the ease of exploitation, public POC, and vm2's popularity in Node.js sandboxing suggest likelihood of active exploitation in affected deployments. Notably, vm2 v3.11.2 fixes three concurrent sandbox escapes (GHSA-9qj6-qjgg-37qq, GHSA-9vg3-4rfj-wgcm, GHSA-2cm2-m3w5-gp2f), indicating vm2's sandbox model had systemic weaknesses in its 3.11.1 state. Priority depends on deployment context: critical for untrusted-code-execution platforms, lower for applications using vm2 for internal scripting of trusted code only. |
| Exploit ScenarioDerived | An attacker targeting an online JavaScript coding playground built with vm2 ≤3.11.1 submits the 9-line POC code through the web interface. When the server executes this code inside the vm2 sandbox (believing it to be safely isolated), the malicious setter on Array.prototype[0] triggers during Buffer allocation, chains through constructor properties to access the Node.js process object, and executes 'child_process.execSync' to run arbitrary shell commands (e.g., installing a reverse shell, exfiltrating environment variables containing API keys, or pivoting to internal infrastructure). Since the CVSS vector shows PR:N (no privileges required), the attacker needs no authentication beyond whatever access the application grants to submit code snippets. The publicly available POC makes this trivial to exploit. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 08, 2026
Remote code execution in vm2 npm package (versions ≤3.11.1) allows attackers to escape the JavaScript sandbox via a prototype pollution technique targeting the neutralizeArraySpeciesBatch method. By installing a setter on Array.prototype[0] and triggering Buffer allocation, attackers gain access to the host Function constructor and can execute arbitrary system commands. Publicly available proof-of-concept exists (GHSA-9qj6-qjgg-37qq). CVSS 9.8 with network vector reflects the risk when vm2 is used to execute untrusted code in server-side applications. Vendor-released patch: vm2 v3.11.2 addresses this and two other concurrent sandbox escapes.
RemediationAI
Upgrade vm2 to version 3.11.2 immediately, which addresses this vulnerability along with GHSA-9vg3-4rfj-wgcm and GHSA-2cm2-m3w5-gp2f. Download from https://github.com/patriksimek/vm2/releases/tag/v3.11.2 or update via npm with 'npm install vm2@3.11.2'. If immediate upgrade is not feasible, implement compensating controls: (1) run vm2 sandboxes inside OS-level containers (Docker, gVisor) with restricted syscalls, network isolation, and read-only filesystem to limit RCE impact - note this adds operational complexity and does not prevent the escape, only contains damage; (2) avoid passing untrusted code to vm2 until patched - instead process untrusted input as pure data, not executable code; (3) if vm2 processes user-provided code, apply strict input validation to block prototype manipulation patterns (Object.defineProperty, __proto__ assignments, Array.prototype modifications) - this is fragile and bypassable but may block known POCs. Be aware that vm2 maintainers documented the fundamental difficulty of building secure JavaScript sandboxes (see docs/ATTACKS.md in the repository). For high-security use cases, consider migrating to OS/VM-level sandboxes (isolated-vm, Docker, Firecracker) rather than in-language JavaScript sandboxes. Official advisory: https://github.com/advisories/GHSA-9qj6-qjgg-37qq.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
vm2 is a Node.js sandbox library designed to execute untrusted JavaScript code in an isolated context. The vulnerability exists in the neutralizeArraySpeciesBatch method, which was introduced to handle cross-realm object interactions. The flaw is a classic JavaScript prototype pollution leading to sandbox escape: when the sandbox code defines a setter on Array.prototype[0] and then creates a Buffer (which internally creates an array), the setter executes with access to host-realm objects. The setter receives host-side objects via value.arr, exposing Buffer.prototype.inspect. Attackers chain through constructor.constructor to reach the host Function constructor, then use Function('return process')() to access Node.js process object and require('child_process') for system command execution. This exploits CWE-668 (Exposure of Resource to Wrong Sphere) - specifically the failure to maintain proper isolation boundaries between sandbox and host realms. The vulnerability demonstrates that JavaScript proxies, getters/setters, and prototype chains create subtle attack surfaces when building sandboxes in-language rather than via OS/VM isolation.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Primary rating from Vendor (https://github.com/patriksimek/vm2).
CVSS VectorVendor: https://github.com/patriksimek/vm2
DescriptionCVE.org
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
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('child_process').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.
Blast Radius
ecosystem impact- 10 npm packages depend on vm2 (4 direct, 6 indirect)
Ecosystem-wide dependent count for version 3.11.2.
Executive ViewAI
CVE-2026-44008 is a critical remote code execution vulnerability in the vm2 npm package (versions ≤3.11.1) that allows attackers to escape the JavaScript sandbox and execute arbitrary system commands on affected servers. Organizations using vm2 to execute untrusted code face immediate risk of full system compromise; this vulnerability requires urgent patching or immediate remediation of vm2 usage across all production environments.
Vendor-released patch: vm2 v3.11.2. If immediate patching is not feasible: (1) Disable or remove vm2 entirely if functionality permits; (2) Restrict vm2 execution to isolated, non-production environments with no sensitive data; (3) Implement strict network egress controls and OS-level command execution restrictions on processes running vm2; (4) Monitor for suspicious child process creation and outbound connections from vm2 processes.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
GHSA-9qj6-qjgg-37qq
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB