Skip to main content

vm2 CVE-2026-45411

| EUVDEUVD-2026-30086 CRITICAL
Exposure of Resource to Wrong Sphere (CWE-668)
2026-05-13 GitHub_M GHSA-248r-7h7q-cr24
9.8
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Submit JavaScript to vm2-backed endpoint
  2. Delivery
    Define async generator with yield* to no-return iterator
  3. Exploit
    Call i.return(thenable) with throwing .then under deep recursion
  4. Install
    V8 PromiseResolveThenableJob captures host-realm RangeError
  5. C2
    Pivot via e.constructor.constructor('return process')()
  6. Execute
    Invoke child_process.execSync for RCE
  7. Impact
    Execute 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 new VM().run(...) (or equivalent NodeVM) sandbox - i.e., the application's threat model already trusts vm2 to contain hostile code. No authentication to the host OS, no user interaction, and no special vm2 configuration are needed beyond the default sandbox; the exploit works against stock new VM() instances. Limiting factors: applications that do not pass untrusted input into vm2 (e.g., using vm2 only for first-party code) are not exploitable in practice, and applications that have already migrated off vm2 to isolated-vm, worker threads with proper isolation, or external sandboxes are unaffected. The exploit relies on V8's PromiseResolveThenableJob behaviour, so any Node.js version shipping a modern V8 (Node 14+) is a viable target.

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 yield* to an iterator without a return method, then calls i.return(thenable) while triggering deep recursion to provoke a host-realm RangeError; the attacker uses binary search to locate the precise depth and pivots through e.constructor.constructor('return process')() to obtain Node's process and call child_process.execSync for arbitrary command execution. A complete working PoC is published in the GHSA advisory and as a GitHub Gist, so weaponisation effort is minimal.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

vm2 < 3.11.3

Affected Packages

npm vm2 fix: 3.11.3

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

Vendor (GitHub_M) PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Red Hat 9.8 HIGH

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

1
Patch available
May 13, 2026 - 19:17 EUVD

DescriptionCVE.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
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 16 npm packages depend on vm2 (5 direct, 11 indirect)

Ecosystem-wide dependent count for version 3.11.3.

Executive ViewAI

Why It Matters

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.

Business Impact: Severe
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.1%
Top 83% exploitable
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

69
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

More in Vm2

View all
CVE-2023-37466 CRITICAL POC
10.0 Jul 14

vm2 is an advanced vm/sandbox for Node.js. Rated critical severity (CVSS 10.0), this vulnerability is remotely exploitab

CVE-2023-32314 CRITICAL POC
10.0 May 15

vm2 is a sandbox that can run untrusted code with Node's built-in modules. Rated critical severity (CVSS 10.0), this vul

CVE-2023-30547 CRITICAL POC
10.0 Apr 17

vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules. Rated critical severity (CVSS 10.

CVE-2023-29199 CRITICAL POC
10.0 Apr 14

There exists a vulnerability in source code transformer (exception sanitization logic) of vm2 for versions up to 3.9.15,

CVE-2022-36067 CRITICAL POC
10.0 Sep 06

vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules. Rated critical severity (CVSS 10.

CVE-2021-23449 CRITICAL POC
10.0 Oct 18

This affects the package vm2 before 3.9.4 via a Prototype Pollution attack vector, which can lead to execution of arbitr

CVE-2026-26956 CRITICAL POC
9.8 May 04

Full sandbox escape with arbitrary code execution allows remote attackers to break out of vm2's Node.js sandbox environm

CVE-2026-24120 CRITICAL POC
9.8 May 04

Sandbox escape in vm2 for Node.js allows remote unauthenticated attackers to execute arbitrary commands on the host syst

CVE-2026-22709 CRITICAL POC
9.8 Jan 26

Sandbox escape in vm2 Node.js sandbox before 3.10.2 via Promise.prototype.then/catch callback sanitization bypass. PoC a

CVE-2023-29017 CRITICAL POC
9.8 Apr 06

vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules. Rated critical severity (CVSS 9.8

CVE-2022-25893 CRITICAL POC
9.8 Dec 21

The package vm2 before 3.9.10 are vulnerable to Arbitrary Code Execution due to the usage of prototype lookup for the We

CVE-2026-92957 CRITICAL POC
9.4 Sep 17

Sandbox escape in the vm2 Node.js library through 3.11.6 lets untrusted code running inside a NodeVM instance reach the

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy