vm2 Sandbox Breakout Vulnerability Allowing Remote Code Execution

Vulnerability

A sandbox breakout vulnerability has been identified in vm2, an open-source virtual machine/sandbox for Node.js, affecting versions through 3.11.1. The issue arises in the method 'neutralizeArraySpeciesBatch', which can interact with objects from the host environment. This interaction exposes host objects, including the Function object, into the vm2 sandbox. Exploiting this vulnerability allows attackers to execute arbitrary commands on the host system, escaping the vm2 sandbox restrictions.

Impact

Exploitation of this vulnerability allows for remote code execution on the host system, bypassing the vm2 sandbox.

Reproduction

To reproduce this vulnerability, use vm2 version 3.11.1 or earlier. The vulnerability can be triggered by defining a setter on the Array prototype that manipulates the sandbox's context. This can be done by creating an array and using the 'neutralizeArraySpeciesBatch' method to expose host objects into the sandbox. Once the host Function object is accessible, it can be used to execute arbitrary commands on the host system, such as creating a file.

Remediation

Users can upgrade to vm2 version 3.11.2 or later to address this vulnerability.

Added: May 13, 2026, 7:48 PM
Updated: May 13, 2026, 7:48 PM

Vulnerability Rating

Custom Algorithm
spread
6.6
impact
10.0
exploitability
5.5
remediation
7.7
relevance
8.2
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.