Improper Isolation or Compartmentalization Affecting vm2 package, versions >=3.9.6 <3.11.0


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-VM2-16439011
  • published8 May 2026
  • disclosed7 May 2026
  • creditakshatgit

Introduced: 7 May 2026

NewCVE-2026-44007  (opens in a new tab)
CWE-653  (opens in a new tab)

How to fix?

Upgrade vm2 to version 3.11.0 or higher.

Overview

vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules.

Affected versions of this package are vulnerable to Improper Isolation or Compartmentalization through the NodeVM constructor in lib/nodevm.js. An attacker can run host commands when the VM is set up with { nesting: true, require: false } and then using sandbox code to require('vm2'), build a nested NodeVM with attacker-chosen require settings, and load child_process. This leaves applications that rely on require: false with a sandbox that still exposes access to host modules to untrusted code, allowing arbitrary command execution as the host process user.

Workaround

If your code uses new NodeVM({ nesting: true, require: false }), remove nesting: true to preserve deny-all behavior and prevent sandbox code from reaching require('vm2').

CVSS Base Scores

version 4.0
version 3.1