Skip to main content
Mallory
← Back to News
open-source-dependency-vulnerabilityproof-of-concept-releasewidely-deployed-product-advisoryinternet-facing-service-vulnerability

Multiple Critical vm2 Sandbox Escapes Enable Host RCE in Node.js

Vulnerability Disclosure · 16 sources · Updated 5mo ago · First seen May 23, 2026

Multiple Critical vm2 Sandbox Escapes Enable Host RCE in Node.js

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
  • Public proof-of-concepts are documented across multiple advisories.
  • No reference in the provided material confirms observed exploitation in the wild.
Do you run this?See affected versions and whether adversaries are exploiting it.
Check your exposure
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

10 events · Feb 8, 2022 – May 22, 2026
  1. May 22, 20266mo ago

    Public reporting summarizes five critical vm2 flaws

    Security Online reported that five critical vm2 vulnerabilities affecting versions up to 3.11.3 enable sandbox escape and host RCE, and said organizations should upgrade to vm2 3.11.4 or later because no configuration workaround exists for untrusted code execution.

  2. May 18, 20266mo ago

    vm2 publishes ATTACKS.md documenting sandbox escape techniques

    The vm2 repository published an ATTACKS.md document cataloging known sandbox escape and breakout techniques affecting the project. The document consolidates technical details on attack chains and serves as project-maintained security documentation for vm2 users and researchers.

    vm2/docs/ATTACKS.md at main · patriksimek/vm2 · GitHub
  3. May 18, 20266mo ago

    GitHub advisory listing shows concentrated vm2 disclosures

    The vm2 security advisories page reflected a wave of newly published disclosures in May 2026, highlighting numerous sandbox escape, RCE, builtin bypass, and data leakage issues affecting the library.

  4. May 1, 20267mo ago

    GitHub publishes multiple vm2 security advisories

    GitHub advisories were published for several vm2 vulnerabilities, including sandbox breakouts through inspect, Promise species handling, prototype pollution-based escapes, and `nesting: true` require bypasses. The advisories describe host command execution and sandbox compromise across affected vm2 versions.

  5. Feb 15, 202610mo ago

    vm2 adds regression tests for sandbox escape techniques

    A vm2 commit added security regression tests covering multiple sandbox escape chains involving property descriptors, prototype traversal, host constructor recovery, and Promise callback sanitization bypass attempts.

  6. Jan 27, 202610mo ago

    Semgrep discloses new vm2 sandbox escape

    Semgrep published research describing a new sandbox escape affecting the popular Node.js sandbox library vm2, marking public disclosure of a fresh breakout technique.

  7. Jan 26, 202610mo ago

    vm2 fixes CVE-2026-22709 in version 3.10.2

    A GitHub Security Advisory published CVE-2026-22709, a critical vm2 sandbox escape caused by improper Promise callback sanitization that could lead to arbitrary code execution outside the sandbox. Maintainers fixed the issue in commit 4b009c2 by replacing Function.prototype.call with Reflect.apply and released vm2 version 3.10.2.

    Critical Sandbox Escape in vm2 Enables RCE | Blog | Endor Labs
  8. May 15, 20234y ago

    GitHub discloses Proxy-related vm2 sandbox escape

    GitHub published a security advisory for a vm2 sandbox escape affecting versions through 3.9.17, caused by unexpected creation of a host object related to Proxy specification behavior. The issue could lead to host remote code execution, had a public proof of concept, and was fixed in vm2 3.9.18 with no workaround provided.

    Sandbox Escape · Advisory · patriksimek/vm2 · GitHub
  9. Apr 8, 20234y ago

    Nesting bypass persisted through vm2 refactor

    The `nesting: true` require-bypass issue remained present after a vm2 refactor in commit `9e2b6051`, allowing the vulnerable behavior to continue in later versions.

  10. Feb 8, 20225y ago

    vm2 nesting flaw introduced in legacy resolver path

    A vm2 flaw that lets a NodeVM with `nesting: true` bypass `require: false` was introduced in commit `2353ce60`, which injected `NESTING_OVERRIDE` into the resolver path and exposed `vm2` inside the sandbox.

Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.

Open in app →
Do you run this?See whether adversaries are exploiting this yet, and where the affected versions run in your environment.
Check Your Exposure
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.