/

CVE-2026-44007

Severity:

CRITICAL RISK

(9.1)

Improper Access Control in vm2 NodeVM Nesting

CVE-2026-44007

Modified

Vulnerability type

Category:

Improper Access Control

CWE:

CWE-284, CWE-1100

Impact:

Remote Code Execution / Sandbox Escape

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

vm2's NodeVM sandbox allows nested virtual machines to bypass require() restrictions when nesting: true is enabled.

Untrusted code running in such a NodeVM can load vm2 itself, spawn a new inner NodeVM with unrestricted require settings, and ultimately execute arbitrary OS commands on the host.

Affected context

This vulnerability affects Node.js applications that:

  • Use vm2's NodeVM to execute untrusted or semi-trusted JavaScript
  • Enable nesting: true in the NodeVM configuration
  • Rely on require restrictions (including require: false) to enforce sandbox boundaries

The issue appears when sandboxed code can obtain access to the vm2 module inside the sandbox, construct new VMs, and escape the original security policy.

Exploit preconditions

  • Attack surface: Any API, plugin system, or feature that evaluates user-supplied code using vm2's NodeVM with nesting: true.
  • Required access: Ability to supply JavaScript that is executed inside the vulnerable NodeVM (e.g., user scripts, templates, expressions, or configuration-defined code).
  • Trigger point: Execution of attacker-controlled code within the NodeVM that calls require('vm2') and creates a new, less-restricted NodeVM instance.
  • Why exploitation is possible: The nested NodeVM bypasses the outer VM's require configuration, allowing construction of an inner VM with full require access, including modules that perform OS-level operations.

Why this happens

The root cause is a broken access control boundary in vm2's handling of nested NodeVM instances.

When nesting: true is set, the sandboxed environment can unconditionally call require('vm2'), regardless of the outer VM's require configuration.

This violates the expectation that disabling or restricting require in the outer VM prevents access to sensitive modules.

Conceptually, this aligns with CWE-284: Improper Access Control, where security policies are inconsistently enforced across nested or delegated components, allowing a bypass of intended restrictions.

Potential impact

  • Execution of arbitrary OS commands on the host running the Node.js process
  • Complete compromise of the application process and its data
  • Lateral movement within the hosting environment, depending on process privileges
  • Exfiltration or tampering of sensitive data handled by the application
  • Use of the compromised host as a platform for further attacks

General mitigation guidance

Effective mitigation focuses on reinforcing sandbox boundaries and limiting trust in nested execution environments:

  • Avoid enabling nesting: true for any NodeVM that executes untrusted or user-supplied code, unless strict additional controls exist.
  • Treat sandbox escape as a realistic failure mode and run sandboxed workloads under separate, least-privilege OS identities or containers.
  • Isolate the code-execution service from critical infrastructure and sensitive data; design for blast-radius reduction.
  • Apply defense-in-depth by combining vm2 with external controls such as process-level seccomp, container sandboxes, and strict filesystem/network permissions.
  • Regularly review and harden sandbox configuration defaults, favoring deny-by-default for capabilities like require, networking, and filesystem access.

How teams detect issues like this

To detect this class of issue, organizations can:

  • Use static analysis or code search to identify creation of NodeVM instances with nesting: true, especially when combined with untrusted input.
  • During code review, flag any pattern where require restrictions are assumed to be sufficient isolation for untrusted code, and verify nested VM access.
  • Implement centralized security wrappers or factory functions for vm2 usage, enforcing safe defaults and disallowing direct creation of nested VMs.
  • Employ runtime monitoring and logging for sandboxed code execution, including alerts for unexpected module loads or OS-level command execution originating from sandboxed contexts.

Sources

SourceLink
openwall.comopenwall.com/lists/oss-security/2026/05/05/11
access.redhat.comaccess.redhat.com/errata/RHSA-2026:50850
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-44007
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2477198
github.comgithub.com/patriksimek/vm2/commit/46cbbdde4e19b743974c942278080231004146ca
github.comgithub.com/patriksimek/vm2/releases/tag/v3.11.1
github.comgithub.com/patriksimek/vm2/security/advisories/GHSA-8hg8-63c5-gwmx
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-44007.json

Frequently asked

questions

It can be, if an application exposes an interface (such as a scripting feature, rules engine, or plugin system) that accepts remote user code and executes it inside a NodeVM with nesting: true. In that scenario, a remote attacker may achieve code execution on the host.

That depends entirely on how the application exposes the sandbox. If only authenticated or internal users can submit code to the NodeVM, then exploitation is limited to those users. If the sandbox is reachable anonymously (e.g., public APIs or web forms), anonymous attackers may exploit it.

The safest pattern is to avoid enabling nesting: true for any NodeVM that runs untrusted code, and to treat the sandbox as an untrusted boundary by running it in a heavily restricted environment (least-privilege user, container isolation, minimal filesystem and network access).

When adopting sandboxing or VM libraries, assume that single-layer isolation may fail and design for defense-in-depth: enforce strict configuration defaults, prevent access to the sandboxing library from inside the sandbox, isolate execution environments at the OS or container level, and periodically review sandbox-related code paths for policy bypasses and privilege boundary inconsistencies.

Find out what's already
exploitable in your codebase.