CVE-2026-47140
JSON

10.0critical

vm2: NodeVM builtin denylist bypass via process and inspector/promises allows host code execution

Severity
10.0critical CVSS:3.1 by GitHub_M
Exploit likelihood
0.82% (higher than 54% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-rp36-8xq3-r6c4

Description

vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.4, NodeVM blocks several dangerous Node.js builtins such as module, worker_threads, cluster, vm, repl, and inspector. However, the denylist misses process and inspector/promises. Both can be used from sandboxed code to reach host-side execution primitives. This allows sandboxed code to bypass the intended builtin restrictions and execute code in the host process. This issue has been patched in version 3.11.4.

Affected

Product or packageVersionsReported by
patriksimek vm2< 3.11.4CVE List
vm2 (npm)before 3.11.4GitHub Advisory Database

All scores

GitHub_M10.0critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
GitHub10.0critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Classification

CWE-693

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.

What each source says

CVE List

vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.4, NodeVM blocks several dangerous Node.js builtins such as module, worker_threads, cluster, vm, repl, and inspector. However, the denylist misses process and inspector/promises. Both can be used from sandboxed code to reach host-side execution primitives. This allows sandboxed code to bypass the intended builtin restrictions and execute code in the host process. This issue has been patched in version 3.11.4.

GitHub Advisory Database

Summary

NodeVM blocks several dangerous Node.js builtins such as module, worker_threads, cluster, vm, repl, and inspector.

However, the denylist misses process and inspector/promises. Both can be used from sandboxed code to reach host-side execution primitives.

This allows sandboxed code to bypass the intended builtin restrictions and execute code in the host process.

Details

The dangerous builtin denylist is defined in lib/builtin.js. This list does not include:

process
inspector/promises

Non-denied builtins are exposed to the sandbox through:

builtins.set(key, special ? special : vm => vm.readonly(hostRequire(key)));

Because of this, sandboxed code can bypass the expected restrictions in two ways:

  1. require('process').getBuiltinModule('child_process') reloads child_process, even when child_process is excluded.
  2. require('inspector/promises') exposes the Inspector protocol and can call Runtime.evaluate in the host process.

PoC

Tested on:

vm2: 3.11.2
Node.js: v25.9.0

Run from the vm2 repository root:

node poc/dangerous-builtin-denylist-rce.js

dangerous-builtin-denylist-rce.js

The PoC first confirms the intended restrictions work:

require("inspector"): BLOCKED
require("child_process"): BLOCKED

Then it bypasses them:

require("process").getBuiltinModule("child_process").execFileSync(...)

This spawns a host child process. It also confirms:

require("inspector/promises").Session().post("Runtime.evaluate", ...)

This evaluates JavaScript in the host process.

Screenshot 2026-05-10 at 11 53 33 AM

Impact

An attacker who can run untrusted JavaScript inside NodeVM with affected builtin settings can escape the sandbox and execute arbitrary code in the host process.

This can lead to full compromise of the application process, including reading files, writing files, spawning processes, and accessing host environment secrets.

(This is not reachable with the default NodeVM configuration where require is disabled or no affected builtins are allowed. It affects applications that allow process, inspector/promises, or the wildcard "*" in require.builtin.)

Suggested fix

Add process and inspector/promises to the dangerous builtin blocklist.

Also consider blocking dangerous builtin families by prefix, for example blocking both:

inspector
inspector/*

instead of only exact module names.

NVD (es)

vm2 es una vm/sandbox de código abierto para Node.js. Antes de la versión 3.11.4, NodeVM bloquea varias funciones integradas (builtins) peligrosas de Node.js, como module, worker_threads, cluster, vm, repl e inspector. Sin embargo, la lista de denegación omite process e inspector/promises. Ambos pueden ser utilizados desde código en sandbox para alcanzar primitivas de ejecución del lado del host. Esto permite al código en sandbox eludir las restricciones de funciones integradas (builtins) previstas y ejecutar código en el proceso del host. Este problema ha sido parcheado en la versión 3.11.4.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-47140 changed 2026-06-13CVE Terms of Use
GitHub Advisory DatabaseGHSA-rp36-8xq3-r6c4 changed 2026-06-12CC-BY-4.0
NVDCVE-2026-47140 changed 2026-10-26Public domain