Impact
vm2 is an open source Node.js virtual machine and sandboxing library. The flaw occurs when a NodeVM is created with nesting:true, which bypasses the outer VM’s require:false setting. Code running inside the sandbox can then require the vm2 module, instantiate a second NodeVM with unrestricted require, and execute arbitrary OS commands on the host. This is an authorization failure (CWE‑284) that results in remote code execution and full compromise of the application and its underlying system.
Affected Systems
The affected product is patriksimek’s vm2. All versions prior to 3.11.1 are vulnerable. The issue is triggered specifically when the outer VM is configured with nesting:true, independent of the require setting. Applications that run untrusted code inside such a nested NodeVM are therefore fully compromised.
Risk and Exploitability
The CVSS score is 9.1, indicating critical severity. EPSS information is not available, so exploitation probability is not quantified, but the flaw is not listed in the CISA KEV catalog. Exploitation requires an attacker to supply malicious code to a NodeVM that has been configured with nesting:true; once the code is executed, the attacker can run any operating‑system command, giving them unrestricted control.
OpenCVE Enrichment
Github GHSA