vm2 NodeVM builtin allowlist bypass sandbox escape

Severity: critical · CVSS 9.9 · Published 2026-09-17

vm2 is a JavaScript sandbox library that isolates untrusted code execution. When running on Node.js 24 and newer, attackers with code execution inside the sandbox can break out by exploiting a flaw in the builtin module allowlist, ultimately executing arbitrary JavaScript on the host system outside the sandbox.

Technologies: vm2 (npm), Patriksimek Vm2. Vendors: npm, Patriksimek.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Critical severity, with a CVSS score of 9.9, published 17 September 2026.
Which products and versions are affected?
vm2 (npm) >= 3.9.6, <= 3.11.6; Patriksimek Vm2 >=3.9.6, <=3.11.6.
Is there a fix for This vulnerability?
A patch was published on 2026-08-24: Fixed in vm2 3.11.7 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network.
Am I affected?
Check whether you run vm2 (npm) or Patriksimek Vm2 at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The vulnerability is a chain of three issues: Node.js 24+ exposes a scheme-only builtin key "node:test" that bypasses vm2's family-based protection mechanism; the generic host-passthrough loader stores it when explicitly allowed; and requireImpl() in lib/setup-node-sandbox.js strips a single "node:" prefix, allowing sandbox code to call require('node:node:test') and obtain a proxy to the host module. Calling node:test.run() with attacker-controlled execArgv spawns an unrestricted host Node process that executes arbitrary code via --eval. Requires the embedder to explicitly allow node:test in the builtin allowlist and Node.js 24+.

Affected products

  • patriksimek vm2 >=3.9.6, <=3.11.6

Timeline

  • 2026-08-24: disclosed
  • 2026-08-24: patched: Fixed in vm2 3.11.7

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.