VM2 CVE-2026-44009
CRITICALAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconSubmit malicious JS to VM2 endpoint
-
DeliveryThrow null-proto object in sandbox
-
ExploitCatch dual-reference exception
-
InstallAccess Buffer.prototype.inspect.constructor
-
C2Obtain host Function object
-
ExecuteExecute require('child_process')
-
ImpactRun arbitrary shell commands
-
Step 8Full host system compromise
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 | Exploitation requires that the target application uses VM2 (versions prior to 3.11.2) to execute attacker-controllable JavaScript code. The specific vulnerable condition is any deployment where untrusted users can supply JavaScript strings that are passed to the VM2 sandbox's run() method or equivalent execution functions. No special VM2 configuration, non-default settings, or feature flags are required - the vulnerability exists in default VM2 installations. The CVSS vector (AV:N/AC:L/PR:N/UI:N) indicates network accessibility with no authentication, but this assumes the application exposes code execution endpoints to unauthenticated users. Real-world exploitation is limited by whether the application architecture allows untrusted code submission to VM2. Applications using VM2 only for internal trusted code or with robust authentication protecting code execution endpoints face reduced risk. The vulnerability affects all Node.js platforms where VM2 can run (Linux, Windows, macOS) with no platform-specific limitations. No user interaction is required beyond submitting the malicious code payload. |
| Impact | The CVSS 9.8 score (AV:N/AC:L/PR:N/UI:N) indicates worst-case severity: network-accessible, low-complexity exploitation requiring no privileges or user interaction. However, real-world risk requires careful assessment of deployment context. The 'network vector' assumes attackers can remotely supply JavaScript code to a VM2 sandbox - this depends entirely on application architecture. Common risk scenarios include code execution platforms, serverless function sandboxes, plugin systems, and online JavaScript playgrounds. In these contexts, the vulnerability enables complete host compromise from sandbox escape. The GitHub advisory confirms a working POC (provided in the description), and the vendor has released version 3.11.2 as a fix. No EPSS score or CISA KEV status is provided in the input data, so widespread exploitation status is unknown. The vulnerability is one of three RCE issues fixed simultaneously in v3.11.2 (GHSA-9vg3-4rfj-wgcm, GHSA-9qj6-qjgg-37qq), suggesting VM2's sandbox model has fundamental design weaknesses. Organizations using VM2 for security boundaries face critical risk and should prioritize remediation. Those not exposing VM2 to untrusted code can deprioritize, but should still upgrade given the severity. Note the CVSS vector suggests unauthenticated network access, but exploitation actually requires the ability to submit code to the sandbox - verify whether your deployment exposes this capability before assuming network-level risk. |
| Exploit ScenarioDerived | An attacker identifies a web application that uses VM2 to execute user-submitted JavaScript code, such as a code playground, serverless function platform, or plugin system. The attacker submits the provided POC code through the application's code execution interface. The malicious script creates an object with null prototype, throws it as an exception, then catches it to obtain both proxied and unproxied references. By setting Buffer.prototype.inspect as a property and accessing its constructor, the attacker gains access to the host's Function object. Using Function to construct a process accessor, the attacker invokes require('child_process').execSync() to execute arbitrary shell commands on the host server, completely bypassing the VM2 sandbox. From here, the attacker can install backdoors, exfiltrate data, pivot to internal networks, or deploy ransomware. |
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) allows complete sandbox escape via null-prototype exception handling flaw. Attackers can execute arbitrary system commands on the host by exploiting a logic error in the exception proxy mechanism that incorrectly handles objects with null prototypes. Public exploit code exists and the vulnerability affects all versions prior to 3.11.2. The CVSS 9.8 severity reflects network-accessible, unauthenticated exploitation requiring no user interaction - however, real-world risk depends on whether untrusted users can supply code to the VM2 sandbox in a given deployment.
RemediationAI
Upgrade to VM2 version 3.11.2 immediately, as confirmed by the release notes at https://github.com/patriksimek/vm2/releases/tag/v3.11.2. This version patches three critical RCE vulnerabilities including GHSA-9vg3-4rfj-wgcm. Update via npm with 'npm install vm2@3.11.2' or 'npm update vm2' if package.json allows. If immediate patching is impossible, disable or restrict access to any application features that allow untrusted users to submit code for VM2 execution - this is the only effective workaround since the vulnerability is in the core sandbox mechanism. Specifically, implement authentication and authorization controls to limit code execution endpoints to trusted users only, though this reduces the utility of the sandbox. Consider replacing VM2 with alternative sandboxing solutions (isolated-vm, Worker threads with limited capabilities) as VM2 has a history of sandbox escape vulnerabilities and the project's security model may be fundamentally flawed. Review application logs for suspicious child_process executions or file system modifications (e.g., unexpected file creation) that could indicate prior exploitation. Note that version 3.11.2 fixes multiple RCE issues simultaneously, suggesting thorough security review was conducted - however, given the pattern of bypasses, defense-in-depth is essential even after patching.
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 popular Node.js sandbox library (npm package) designed to execute untrusted JavaScript code in an isolated environment. The vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) exists in the exception handling bridge between the sandbox and host realms. When VM2's handleException function processes exceptions, it uses a heuristic to distinguish sandbox objects from host objects based on prototype chains. The post-GHSA-mpf8 hardening code specifically checks prototypes to decide whether to proxy an exception. However, objects with explicitly null prototypes (__proto__: null) confuse this logic - the exception handler incorrectly treats them as host-realm objects requiring proxying. When such an object is thrown from the sandbox and caught, the attacker receives both the proxied and unproxied references. By manipulating properties on these dual references, attackers can access the host's Function constructor through Buffer.prototype.inspect.constructor, then invoke process.mainModule.require to load child_process and execute arbitrary shell commands. This breaks the fundamental security boundary that VM2 is designed to enforce.
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
In handleException due to `// SECURITY (post-GHSA-mpf8 hardening): use from (not ensureThis) exceptions with a null proto will be assumed to come from the other side and being proxied. Therefore, it is possible to get the proxied and unproxied object of a sandbox object with a null proto when thrown and then catched which allows to get the host Function` object.
PoC
const {VM} = require("vm2");
const vm = new VM();
console.log(vm.run(`
const o = {__proto__: null};
try {
throw o;
} catch (e) {
e.f = Buffer.prototype.inspect
o.f.constructor("return process")().mainModule.require('child_process').execSync('touch pwned');
}
`));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-44009 is a critical remote code execution vulnerability in the VM2 npm package that allows attackers to completely bypass sandbox protections and execute arbitrary system commands on affected hosts without authentication or user interaction. Organizations using VM2 to isolate untrusted code execution face immediate risk of full system compromise if deployed in production environments accepting external code submissions.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Restrict VM2 deployment to trusted code execution contexts only-disable any functionality allowing untrusted user input to the sandbox; (2) Implement network segmentation to limit lateral movement from compromised VM2 processes; (3) Apply strict file system and system call restrictions via OS-level controls (seccomp, AppArmor, SELinux) on VM2 process isolation; (4) Monitor VM2 process execution for unexpected system calls or child process spawning. These controls reduce but do not eliminate risk-vendor patch is required for full remediation.
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-9vg3-4rfj-wgcm
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB