Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessRun untrusted JS inside vm2 sandbox
-
DeliveryInstall accessor on Array.prototype[N]
-
ExploitRead error.stack to trigger prepareStackTrace
-
ExecutionBridge formatter invokes sandbox setter
-
ImpactObserve/intercept stack-trace lines
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V15 - Secure Coding and Architecture Protection mechanism completeness
|
| Exploitation Conditions | Requires the application to run attacker-controlled JavaScript inside a vm2 sandbox at version <= 3.11.3 (the core vm2 threat model). The sandboxed code must install an accessor on Array.prototype for the index the bridge writes, then cause the bridge's defaultSandboxPrepareStackTrace in lib/setup-sandbox.js to run by reading error.stack (or otherwise triggering Error.prepareStackTrace). Limiting factors: exploitation is local to the sandbox process (AV:L), high complexity (AC:H) due to the timing/prototype-setter arrangement, and the leaked data is limited to formatted stack-trace strings - there is no code execution or escape, which is why the vendor rates it Low. |
| Impact | This is a genuinely low-priority issue and the signals are internally consistent. The vendor rates it Low and assigns CVSS 4.0 base 2.1 (AV:L/AC:H/PR:N/UI:N with only SI:L set and all vulnerable-system impacts VC:N/VI:N/VA:N), reflecting that the practical effect is a bridge-internal information side channel, not a sandbox escape or RCE. There is no EPSS score, no CISA KEV listing, and no public exploit code identified at time of analysis, so exploitation status is 'no public exploit identified at time of analysis.' No SSVC decision data was provided. The one notable inconsistency is that the vendor vector attributes impact to Subsequent-System Integrity (SI:L) with confidentiality VC:N, yet the description explicitly says the flaw lets sandbox code 'observe and intercept each stack-trace line' - that reads as a confidentiality/information-disclosure side channel rather than an integrity impact; verify metric mapping with the vendor. Even so, the values leaked are formatted strings only, and the whole issue presupposes the vm2 threat model (an application deliberately running attacker-controlled JavaScript inside vm2), so real-world risk remains low regardless of which impact letter is set. The 'Authentication Bypass' tag in the input is not supported by any source data. |
| Exploit ScenarioDerived | An application uses vm2 (<=3.11.3) to execute untrusted JavaScript. The sandboxed code installs an accessor on Array.prototype at the index the bridge's stack-trace formatter will write to, then triggers Error.prepareStackTrace by reading error.stack, causing the bridge to invoke the attacker's setter and letting the sandbox observe each formatted stack-trace line. No public exploit code exists; impact is limited to an information side channel and a violation of vm2's bridge-container defense invariant, not code execution. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 17, 2026
Sandboxed JavaScript running in the npm package vm2 3.11.3 and earlier can install an accessor on Array.prototype so that the bridge's defaultSandboxPrepareStackTrace routine writes each stack-trace line through that attacker-controlled setter, allowing in-sandbox code to observe and intercept the formatted stack-trace strings the host builds. The impact is confined to a low-bandwidth information side channel and a violation of vm2's documented bridge-container defense invariant; there is no sandbox escape and no code execution, which is why the vendor rates the issue Low, consistent with a published CVSS 4.0 base score of 2.1 and our assessed CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N. The practical precondition is that the host application runs attacker-controlled JavaScript inside a vulnerable vm2 sandbox and that the sandboxed code arrange a prototype setter before error.stack (or any path triggering Error.prepareStackTrace) is read; no public exploit code or active exploitation has been identified at time of analysis, and the assessed vector carries PR:N, meaning no additional privileges beyond sandbox code execution are required.
RemediationAI
Upgrade to vm2 3.11.4, the release that installs each stack-trace entry as an own data property via Reflect.defineProperty, as documented in GHSA-q3fm-4wcw-g57x and implemented in commit ad31adc1fc4a2c163f2f8c11ab4af206074528fd; vendor-released patch: vm2 3.11.4. Because this is an information side channel rather than a sandbox escape and no public exploit has been identified, upgrade can proceed on a normal maintenance cadence, but if 3.11.4 cannot be adopted immediately, compensating controls include running the vm2 sandbox inside a separate low-privilege process or worker (trade-off: added operational complexity and IPC overhead) so intercepted stack-trace strings cannot reach sensitive host state, and ensuring that no secrets, credentials, or internal hostnames are embedded in values that appear in sandbox-visible error messages or stack frames (trade-off: reduced debuggability). Freezing or sealing the sandbox realm's Array.prototype before executing untrusted code can break the specific setter-based interception (trade-off: it is itself a realm-wide hardening step that may break legitimate sandboxed code which mutates prototypes, and it does not address every prototype-walking write site). Longer-term, teams relying on vm2's threat model should track the ongoing Invariant #11 audit of lib/setup-sandbox.js and consider a maintained isolation primitive such as isolated-vm or OS-level process/container isolation for the highest-risk workloads.
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 Node.js sandbox library (maintained by patriksimek) that runs untrusted JavaScript in a separate V8 realm and mediates all interaction with the host through a 'bridge' layer. The flaw is classified as CWE-693 (Protection Mechanism Failure): the bridge's defense mechanism, rather than any cryptographic or memory-safety primitive, is what fails. Specifically, defaultSandboxPrepareStackTrace in lib/setup-sandbox.js (around lines 601-610, plus the catch branch at line 607) builds its result array with the prototype-walking index assignment lines[lines.length] = value. Because that array is allocated in the sandbox realm and has no own data property at the written index, V8 walks the prototype chain and can invoke a sandbox-installed setter on Array.prototype[N] every time the bridge formats a stack frame. This is precisely the pattern that was recently codified as vm2's Defense Invariant #11 ('bridge-internal containers must not invoke sandbox code') after GHSA-9qj6-qjgg-37qq (commit ca195f0) fixed the same class of bug in lib/bridge.js via neutralizeArraySpeciesBatch; that audit was scoped to bridge.js and missed setup-sandbox.js, so the invariant was left violated in the stack-trace formatter. The values written are only formatted strings produced by the wrapped CallSite class (whose safe toString yields 'CallSite {}'), so the leak is limited to stack-trace text rather than object references. The fix in 3.11.4 installs each entry as an own data property through Reflect.defineProperty, restoring the prototype-bypassing behavior required by Invariant #11.
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
CVSS:4.0/AV:L/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N
Local sandbox code with no auth (PR:N) but high complexity (AC:H) crosses the sandbox/bridge boundary (S:C) to leak formatted stack-trace strings (C:L); no integrity or availability impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
1DescriptionCVE.org
vm2 is a sandbox for running untrusted JavaScript. In vm2 versions up to and including 3.11.3, the defaultSandboxPrepareStackTrace function in lib/setup-sandbox.js builds its output array using prototype-walking index assignment (lines[lines.length] = value) rather than a prototype-bypassing define-property primitive. Because this bridge-internal array is allocated in the sandbox realm, code inside the sandbox can install an accessor on Array.prototype for the relevant index; the accessor is then invoked whenever the sandbox reads error.stack (or otherwise triggers Error.prepareStackTrace), allowing sandbox code to observe and intercept each stack-trace line written by the bridge. The same pattern is used in the error-handling (catch) branch. The values written are formatted strings only, so the practical impact is limited to an information side channel and a violation of vm2's bridge-container defense invariant rather than a sandbox escape; the vendor rates the issue Low. The issue is fixed in vm2 3.11.4, which installs each entry as an own data property via Reflect.defineProperty.
Blast Radius
ecosystem impact- 5 npm packages depend on vm2 (4 direct, 1 indirect)
Ecosystem-wide dependent count for version 3.11.4.
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
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 (patriksimek/vm2) versions prior to 3.11.3 enables remote code execution on the host Node.js proce
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
EUVD-2026-81612
GHSA-2c9f-f88g-g76p
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB