ZeroHour

CVE-2026-92937

mass

Sandbox escape with host RCE in vm2 3.11.6 via unsanitised Promise rejection

CVSS 4.0
10.0 critical
EPSS
Published
()
Modified
AI analysis

vm2 3.11.6 is vulnerable to a sandbox escape that lets untrusted code running inside the sandbox execute arbitrary code in the host Node.js process; it is an incomplete fix for GHSA-m283-3h24-438v, where the Promise-sanitising bridge gate (lib/bridge.js:1624) identity-checks only the direct call target. It is triggered when an embedder exposes a host-realm Promise to the sandbox (e.g., an async host function bridged via the sandbox option, or an async method of a NodeVM external module) that rejects with an Error carrying a non-primitive own property referencing a host object, and the attacker invokes the rejection handler through a Function.prototype.call or .apply indirection such as p.then.call(p, undefined, cb), which bypasses the sanitiser and delivers the raw host error with its own properties intact. The attacker thereby obtains a fully functional proxy to a host object and can reach Node internals, for example err.detail.mainModule.require('child_process'), to run arbitrary commands with the privileges of the host process. Any Node.js application embedding vm2 3.11.6 (or earlier builds carrying the incomplete fix) that bridges host Promises into the sandbox is affected; the direct p.then(undefined, cb), bind, and Reflect.apply forms are correctly sanitised. No public proof-of-concept is known, the flaw is not in CISA KEV, and no in-the-wild exploitation has been reported; a fixed version, 3.11.7, is available.

What to do: Upgrade vm2 to 3.11.7 immediately. Audit your embedding for host-realm Promises or async host functions (via the sandbox option or NodeVM external modules) that can reject with Errors carrying non-primitive own properties, and avoid exposing host objects such as process into error payloads. Given vm2's repeated history of sandbox escapes, consider running untrusted code under stronger isolation (e.g., a separate process/container or a hardened isolation library) rather than relying on vm2 alone.

Affected
vm2 (open-source Node.js sandbox library) vm2<= 3.11.6 (builds containing the incomplete GHSA-m283-3h24-438v fix); fixed in 3.11.7
Estimated exposure
masshundreds of thousands of Node.js deployments (vm2 has historically averaged hundreds of thousands of weekly npm downloads), of which only sandbox embeddings… — Estimated from public npm registry download volume for vm2, one of the most widely used JavaScript sandboxing libraries, tempered by the fact that exploitation requires the embedder to expose host-realm Promises or async host functions to…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

vm2 3.11.6 is vulnerable to a sandbox escape leading to remote code execution in the host Node.js process. The fix for GHSA-m283-3h24-438v is incomplete: the bridge gate at lib/bridge.js:1624 identity-checks only the direct call target when deciding whether to rebuild/sanitise a rejected host Promise value. Registering the rejection handler through Function.prototype.call or .apply indirection (e.g., p.then.call(p, undefined, cb)) makes the intercepted target host Function.prototype.call, so the sanitiser never runs and the raw host error reaches sandbox code with its own properties intact. If an embedder exposes a host-realm Promise to the sandbox (an async host function bridged via the sandbox option, or a NodeVM external module's async method) and that Promise rejects with an Error carrying a non-primitive own property referencing a host object (for example err.detail = process), untrusted code in the sandbox obtains a fully functional proxy to that host object and can execute arbitrary commands with the privileges of the host process (e.g., e.detail.mainModule.require('child_process').execSync(...)). The direct p.then(undefined, cb), bind, and Reflect.apply forms are correctly sanitised. Fixed in vm2 3.11.7.

Weakness
CWE-94
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In the news

No ingested article mentions this CVE yet.