Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconSubmit JavaScript to vm2-backed endpoint
-
DeliveryDefine async generator with yield* to no-return iterator
-
ExploitCall i.return(thenable) with throwing .then under deep recursion
-
InstallV8 PromiseResolveThenableJob captures host-realm RangeError
-
C2Pivot via e.constructor.constructor('return process')()
-
ExecuteInvoke child_process.execSync for RCE
-
ImpactExecute arbitrary commands as Node.js host user
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Resource sphere isolation
MITRE ATT&CK
1 technique across 1 tactic: Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the target application (a) embeds vm2 at version <= 3.11.2 and (b) evaluates attacker-controlled JavaScript inside a |
| Impact | Signals diverge: CVSS 9.8 (AV:N/AC:L/PR:N/UI:N/C:H/I:H/A:H) and SSVC (exploitation=poc, automatable=yes, technical impact=total) both rate this critical, and a working PoC is published on GitHub Gist, yet EPSS is only 0.05% (17th percentile) and the CVE is not in CISA KEV. The CVSS AV:N/PR:N rating is technically accurate but somewhat misleading - exploitation presupposes that an application already accepts and evaluates untrusted JavaScript inside a vm2 sandbox, which is itself the threat model vm2 exists to address; for applications that do (server-side code playgrounds, plugin runtimes, expression evaluators, SSRF-proxying renderers), this is a direct path to full host RCE with no authentication or user interaction. The low EPSS likely reflects that vm2 has been deprecated by its maintainer for over a year due to repeated unfixable escapes, so the realistic exploited population is narrower than a generic 9.8 would suggest - but for any system still running vm2 to isolate untrusted code, this should be treated as a top-priority issue. |
| Exploit ScenarioDerived | A SaaS application that uses vm2 to evaluate user-supplied JavaScript (e.g., custom transform rules, formula fields, plugin code, or a code-execution playground) accepts a payload that defines an async generator delegating via |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 08, 2026
Sandbox escape in vm2 (patriksimek/vm2) versions prior to 3.11.3 enables remote code execution on the host Node.js process by abusing async generator yield* semantics to smuggle a host-realm exception into sandbox code, where the attacker pivots through .constructor.constructor to reach process and child_process.execSync. The flaw is exploitable by any attacker who can run JavaScript inside the sandbox, has publicly available exploit code, and carries SSVC technical impact 'total' with automatable=yes, though EPSS remains low at 0.05% (17th percentile) and the CVE is not listed in CISA KEV.
RemediationAI
Vendor-released patch: vm2 3.11.3 - upgrade immediately via npm install vm2@3.11.3 or equivalent lockfile update, per the GHSA-248r-7h7q-cr24 advisory (https://github.com/patriksimek/vm2/security/advisories/GHSA-248r-7h7q-cr24) and the fix commit 093494c0c3ef2390d2e56909f9d56e290e6f18b0. Because vm2 has a long history of similar sandbox escapes and is no longer actively maintained as a security boundary, the strongly recommended remediation is to migrate away from vm2 entirely to isolated-vm or to OS-level isolation (separate process, container, V8 isolate, or WASM runtime) for evaluating untrusted code; this is the only durable mitigation against the broader class of escapes and is the path the upstream maintainer has publicly recommended. If immediate migration is not feasible and 3.11.3 cannot be applied right away, do not accept attacker-controlled JavaScript into vm2 - gate the sandbox behind authentication, refuse code submission from untrusted callers, drop privileges on the Node.js process (non-root user, seccomp, read-only filesystem) so a successful escape lands in a constrained environment, and monitor for unexpected child_process spawns from the Node host; the trade-off is that all of these are defense-in-depth and do not actually close the bug.
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 library that purports to provide a secure JavaScript sandbox by isolating untrusted code from the host realm via a transformer, a proxy bridge, and overrides of Promise.prototype.then and catch handlers. The root cause is CWE-668 (Exposure of Resource to Wrong Sphere): when an async generator delegates via yield* to an inner iterator lacking a return method, calling i.return(thenable) causes V8's internal PromiseResolveThenableJob to invoke thenable.then in C++ and catch any synchronous throw without going through a JavaScript try/catch or the user-visible Promise.prototype.then. Both of vm2's existing chokepoints - the transformer's catch-clause instrumentation and the globalPromise.prototype.then rejection sanitiser - are bypassed, so a host-realm RangeError triggered by deep recursion inside the V8 resolver job is surfaced to sandbox code unwrapped, exposing the host Function constructor and from there the Node.js process global. CPE coverage is cpe:2.3:a:patriksimek:vm2:* with all versions <= 3.11.2 affected.
Know when Vm2 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
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.3, it is possible to catch a host exception using the yield* expression inside an async generator. When the generator is closed using the return function, the value is awaited on and exceptions thrown in the then call will be caught by the runtime and passed to the yield* iterator as the next value. This allows attackers to write code which can escape from the VM2 sandbox and execute arbitrary commands on the host system. This vulnerability is fixed in 3.11.3.
Blast Radius
ecosystem impact- 16 npm packages depend on vm2 (5 direct, 11 indirect)
Ecosystem-wide dependent count for version 3.11.3.
Executive ViewAI
vm2 versions prior to 3.11.3 contain a critical sandbox escape vulnerability enabling remote code execution on the host Node.js process; publicly available exploit code exists for this vulnerability. Organizations using vm2 for code sandboxing-such as for user-submitted scripts, plugins, or untrusted code execution-face complete system compromise and potential data breach or lateral movement into critical infrastructure. Exploitation requires only the ability to execute JavaScript within the sandbox, making this a broadly accessible attack surface across many application deployments.
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
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
vm2 is an advanced vm/sandbox for Node.js. Rated critical severity (CVSS 10.0), this vulnerability is remotely exploitab
vm2 is a sandbox that can run untrusted code with Node's built-in modules. Rated critical severity (CVSS 10.0), this vul
vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules. Rated critical severity (CVSS 10.
There exists a vulnerability in source code transformer (exception sanitization logic) of vm2 for versions up to 3.9.15,
vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules. Rated critical severity (CVSS 10.
This affects the package vm2 before 3.9.4 via a Prototype Pollution attack vector, which can lead to execution of arbitr
Full sandbox escape with arbitrary code execution allows remote attackers to break out of vm2's Node.js sandbox environm
Sandbox escape in vm2 for Node.js allows remote unauthenticated attackers to execute arbitrary commands on the host syst
Sandbox escape in vm2 Node.js sandbox before 3.10.2 via Promise.prototype.then/catch callback sanitization bypass. PoC a
vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules. Rated critical severity (CVSS 9.8
The package vm2 before 3.9.10 are vulnerable to Arbitrary Code Execution due to the usage of prototype lookup for the We
Sandbox escape in the vm2 Node.js library through 3.11.6 lets untrusted code running inside a NodeVM instance reach the
EUVD-2026-30086
GHSA-248r-7h7q-cr24
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB