Brief Summary: CVE-2026-26332 — vm2 Sandbox Escape via SuppressedError Leading to Arbitrary Code Execution

A short review of CVE-2026-26332, a critical sandbox escape in the vm2 Node.js package that allows attackers to leverage SuppressedError to break out of the sandbox and execute arbitrary code on the host system. All versions prior to 3.11.0 are affected.

CVE Analysis

6 min read

ZeroPath CVE Analysis
ZeroPath CVE Analysis

2026-05-04

Brief Summary: CVE-2026-26332 — vm2 Sandbox Escape via SuppressedError Leading to Arbitrary Code Execution
Experimental AI-Generated Content

This CVE analysis is an experimental publication that is completely AI-generated. The content may contain errors or inaccuracies and is subject to change as more information becomes available. We are continuously refining our process.

If you have feedback, questions, or notice any errors, please reach out to us.

[email protected]

Introduction

A sandbox escape in the vm2 Node.js package allows an attacker to break out of the isolated execution environment and run arbitrary commands on the host system, earning a CVSS 3.1 base score of 9.8. For any application relying on vm2 to safely execute untrusted JavaScript, this vulnerability completely undermines the core security guarantee the library is designed to provide.

vm2 is an open source sandbox and virtual machine module for Node.js, widely used to execute untrusted code in an isolated context. It is a notable package in the Node.js ecosystem, frequently adopted in platforms that need to run user supplied scripts, plugins, or expressions without granting access to the host environment. Its presence in the National Vulnerability Database and the volume of security advisories it has accumulated reflect both its adoption and the difficulty of maintaining robust sandboxing in JavaScript.

Technical Information

The root cause of CVE-2026-26332 lies in how vm2 handles the SuppressedError object. SuppressedError is a relatively newer JavaScript error type associated with the Explicit Resource Management proposal (the using keyword and DisposableStack). The vm2 sandbox failed to properly sanitize or proxy this error type, leaving a path through which internal references to host realm constructors could be accessed from within sandboxed code.

The attack flow, as described in the official GitHub security advisory (GHSA-55hx-c926-fr95), proceeds as follows:

  1. The attacker creates a DisposableStack inside the sandbox and manipulates it to trigger a SuppressedError.
  2. When the SuppressedError is caught, the attacker accesses e.suppressed.constructor.constructor. Because the SuppressedError object was not properly wrapped by the sandbox's proxy layer, this chain resolves to the host realm's Function constructor rather than the sandboxed one.
  3. With a reference to the host's Function object, the attacker can construct and invoke arbitrary functions that execute outside the sandbox boundary.
  4. The attacker uses this capability to require the node:child_process module and execute arbitrary system commands on the host, such as echo pwned.

The advisory confirms this exploit was demonstrated against Node.js version 24.13.0 running vm2 version 3.10.4.

The National Vulnerability Database maps this vulnerability to two CWE classifications:

CWE IDVulnerability Type
CWE 94Improper Control of Generation of Code (Code Injection)
CWE 693Protection Mechanism Failure

CWE 94 captures the fact that the attacker can inject and execute arbitrary code. CWE 693 captures the broader failure: the sandbox protection mechanism itself was bypassed. Together, these classifications describe a complete breakdown of the isolation boundary that vm2 is supposed to enforce.

The CVSS 3.1 vector reflects the severity: the attack is network accessible, requires low complexity, needs no privileges or user interaction, and results in complete compromise of confidentiality, integrity, and availability on the host.

Affected Systems and Versions

ComponentAffected VersionsFixed Version
vm2 (npm package)All versions less than or equal to 3.10.43.11.0

Any Node.js application that includes vm2 as a dependency at version 3.10.4 or earlier is vulnerable. The exploit was specifically confirmed on Node.js 24.13.0 with vm2 3.10.4, but the advisory indicates all prior versions are affected.

Organizations should audit their dependency trees (using tools such as npm ls vm2 or yarn why vm2) to identify both direct and transitive dependencies on vulnerable versions.

Vendor Security History

The vm2 project has a documented history of sandbox escape vulnerabilities. The version 3.11.0 release that patches CVE-2026-26332 also addresses at least seven other security advisories, the majority of which are Remote Code Execution flaws:

Advisory IDDescriptionImpact
GHSA grj5 jjm8 h35pArray species self return sandbox escapeRemote Code Execution
GHSA v37h 5mfm c47cHandler reconstruction via util.inspect leakRemote Code Execution
GHSA qcp4 v2jj fjx8Trap method on leaked handler with forged targetRemote Code Execution
GHSA 47x8 96vw 5wg6Cross realm symbol extraction from host objectsRemote Code Execution
GHSA 55hx c926 fr95Promise structural leak and SuppressedError sanitisationRemote Code Execution
GHSA vwrp x96c mhwqHost intrinsic prototype pollution via bridge write trapsPrototype Pollution
GHSA 947f 4v7f x2v8NodeVM builtin allowlist bypass via host passthroughRemote Code Execution
GHSA hw58 p9xv 2mjhPromise executor unhandled rejectionDenial of Service

The volume and severity of these fixes in a single release point to systemic challenges in maintaining the sandbox boundary. Each new JavaScript language feature (such as SuppressedError, DisposableStack, or changes to Proxy behavior) introduces potential new attack surface that the sandbox must account for. Security teams relying on vm2 should factor this track record into their risk assessments and consider whether the library's isolation guarantees are sufficient for their threat model.

References

Detect & fix
what others miss

Security magnifying glass visualization