Multiple Critical vm2 Sandbox Escapes Enable Host RCE in Node.js
Vulnerability Disclosure · 16 sources · Updated 5mo ago · First seen May 23, 2026

A wave of disclosures has exposed multiple critical flaws in the Node.js sandbox library vm2, showing that untrusted JavaScript can break out of the sandbox and execute commands on the host. GitHub advisories describe several distinct escape paths affecting versions as old as 3.9.6 and, in some cases, up to 3.11.3, including a breakout through Node.js inspect, a Promise species bypass that defeats an earlier patch, prototype pollution through vm2’s bridge to host intrinsic prototypes, and a NodeVM misconfiguration path where nesting: true lets code bypass require: false and load vm2 recursively to reach modules such as child_process. Public proof-of-concepts show attackers recovering the host process object and invoking host commands, turning vm2 from a containment boundary into a route to full host compromise.
Additional reporting and upstream changes indicate the problems are broader than a single bug. Semgrep documented a new sandbox escape, while vm2 maintainers added regression tests covering descriptor- and prototype-traversal techniques used to recover host constructors such as Function, AsyncFunction, and GeneratorFunction, as well as callback sanitization bypasses tied to Promise handling. A later roundup described five critical vulnerabilities with no practical configuration-based workaround for deployments that execute untrusted code, and urged upgrades to vm2 3.11.4 or later. The advisory backlog on the project’s GitHub page shows a concentrated set of newly published sandbox escape, builtin bypass, and host code execution issues, underscoring that organizations relying on vm2 for isolation should treat affected environments as potentially compromised.
Why it matters
Impact assessment
Multiple critical vm2 flaws break the library’s core security promise: running untrusted JavaScript safely inside Node.js. Any organization using vm2 to execute tenant, plugin, notebook, CI, or user-supplied code is at risk of full host compromise, including theft of secrets, file access, database exposure, and arbitrary OS command execution.
The impact is severe because several issues are rated Critical, some with CVSS 10.0, and the disclosures indicate no effective configuration-only workaround when untrusted scripts are allowed. Exposure is broad across vm2 deployments up to 3.11.3, with some bugs affecting older version ranges or specific NodeVM/runtime configurations; public proof-of-concepts are available, but the provided references do not confirm active exploitation in the wild.
Affected populations and products
- Product: vm2 Node.js sandbox library
- Affected versions called out across references:
- All five newly disclosed issues affect vm2 up to and including 3.11.3
- Specific advisories also affect ranges including 3.9.6-3.10.5, <=3.10.3, <=3.10.4, <=3.10.1, and <=3.9.17
- High-risk use cases:
- Multi-tenant code execution platforms
- Plugin and extension systems
- Notebook/REPL services
- CI sandboxing tools
- Any service evaluating user-supplied JavaScript with vm2
Severity and business consequences
- Host-side remote code execution is achievable from sandboxed code.
- Likely consequences include:
- Exposure of environment variables, tokens, credentials, and secrets
- Read/write access to local files and application data
- Access to application databases
- Process execution as the host service account
- Lateral movement and persistence opportunities on the host/network
- Reputational and financial impact is high for SaaS platforms or shared execution environments because one tenant’s code can compromise shared infrastructure.
Scope and exploitation status
- Scope is widespread for organizations still relying on vm2 as a security boundary.
- Some exploit paths require specific conditions:
- NodeVM with
nesting: true - Builtin wildcard or dangerous builtin exposure such as
module - Async/runtime conditions such as JSPI-backed Promise handling on Node 26
- NodeVM with
- Public proof-of-concepts are documented across multiple advisories.
- No reference in the provided material confirms observed exploitation in the wild.


