Skip to content
Threat Feed
critical advisory

vm2 Sandbox Escape Vulnerability Leading to RCE

A sandbox escape vulnerability exists in the vm2 npm package, specifically in versions 3.10.5 and earlier, allowing an attacker to reach BaseHandler.getPrototypeOf via util.inspect, potentially leading to arbitrary prototype access and remote code execution (RCE).

CVE search metadata

CVE search record: CVE-2026-44006. KEV: no. Product: vm2 (<= 3.10.5). Brief: vm2 Sandbox Escape Vulnerability Leading to RCE. Brief link: https://feed.craftedsignal.io/briefs/2024-01-02-vm2-sandbox-escape/

Triage facts

Revision 2
Applicability
vm2 (<= 3.10.5)
Evidence
Unknown
Severity
Critical
Sources
1 public source
Freshness
Revision 2May 7, 03:54 UTC
Detection
2 rules
Vulnerabilities
1 CVE
Revision history 1 entry · Revision 2
  1. Revision 2

    Repaired a legacy canonical identity collision

    Changed: slug

The vm2 npm package, a sandbox for executing untrusted JavaScript code, is vulnerable to a sandbox escape that can lead to remote code execution (RCE). This vulnerability, affecting versions 3.10.5 and earlier, stems from the ability to reach BaseHandler.getPrototypeOf through manipulation of util.inspect. By exploiting this flaw, an attacker can gain access to arbitrary prototypes within the vm2 sandbox, bypassing security restrictions and ultimately executing arbitrary code on the host system. The vulnerability was reported on May 7, 2026, and poses a significant risk to applications relying on vm2 for secure JavaScript execution. Successful exploitation allows attackers to break out of the sandbox environment and compromise the underlying system.

Attack Chain

  1. The attacker crafts a malicious JavaScript payload designed to exploit the util.inspect function within the vm2 sandbox.
  2. The payload leverages the subarray and slice properties of the Buffer.prototype to trigger the inspect function.
  3. The showHidden and showProxy options are enabled in util.inspect to expose internal properties and proxies.
  4. Within the stylize function, the attacker gains access to the BaseHandler.getPrototypeOf method.
  5. Using getPrototypeOf, the attacker retrieves the prototype of the Buffer object multiple times to reach the HObjectProto and subsequently its constructor HObject.
  6. The attacker retrieves a symbol from the Buffer.prototype using HObject.getOwnPropertySymbols.
  7. A new object is created with the retrieved symbol as a key, whose value is a function that retrieves the child_process module.
  8. Finally, the attacker uses child_process.execSync to execute arbitrary commands on the host system, escaping the vm2 sandbox and achieving RCE.

Impact

Successful exploitation of this vulnerability allows attackers to bypass the vm2 sandbox and execute arbitrary commands on the host system. This can lead to complete system compromise, including data theft, malware installation, and denial of service. The vulnerability affects any application using vm2 versions 3.10.5 or earlier, potentially impacting a wide range of projects that rely on secure JavaScript execution. Given the severity (critical) and the potential for RCE, immediate action is required to mitigate this risk.

Recommendation

  • Upgrade the vm2 npm package to a version greater than 3.10.5 to patch the vulnerability (CVE-2026-44006).
  • Monitor application logs for suspicious activity related to util.inspect and Buffer manipulation, which may indicate exploitation attempts.
  • Implement strict input validation and sanitization to prevent attackers from injecting malicious JavaScript code into the vm2 sandbox.

Detection coverage 2

Detect vm2 Sandbox Escape - Suspicious util.inspect Usage

high

Detects suspicious usage of util.inspect with showHidden and showProxy options, which is indicative of attempts to exploit the vm2 sandbox escape vulnerability.

sigma tactics: execution, privilege_escalation techniques: T1068 sources: process_creation, linux

Detect vm2 Sandbox Escape - child_process.execSync in WebAssembly

critical

Detects the execution of child_process.execSync within a WebAssembly module, which is a strong indicator of a sandbox escape attempt in vm2.

sigma tactics: execution, privilege_escalation techniques: T1068 sources: process_creation, linux

Detection queries are available on the platform. Get full rules →