Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit malicious JS to vm2 sandbox
-
Deliveryrequire('vm2') via enabled require.external
-
ExploitInstantiate unrestricted NodeVM instance
-
ExecutionInvoke child_process for OS commands
-
ImpactExecute arbitrary code 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 | Requires the embedding application to (1) run untrusted attacker-supplied JavaScript inside vm2 (the sandbox's threat model) AND (2) enable require.external WITHOUT an explicit require.root that excludes node_modules - this specific configuration is the trigger. Under that config the sandbox can require('vm2') itself and build an unrestricted NodeVM. Limiting factors: both preconditions are operator-chosen and non-default; applications that leave require.external disabled, or that set require.root to exclude node_modules, are not exploitable. Fixed in vm2 3.11.7. No user interaction or host-side authentication beyond the ability to feed code into the sandbox. |
| Impact | CVSS 4.0 base scores 10.0 (all impact metrics High, AV:N/AC:L/PR:N/UI:N with subsequent-system SC:H/SI:H/SA:H reflecting a full sandbox escape), which is credible for a working host RCE: sandboxed code escapes to run arbitrary OS commands via child_process. However, this maximal score is conditional. The vulnerability only manifests when the embedding application enables require.external WITHOUT setting a require.root that excludes node_modules - a non-default, operator-chosen configuration. It also presupposes the core vm2 threat model: the application is deliberately running attacker-controlled JavaScript inside the sandbox. No EPSS score, no CISA KEV listing, and no independently confirmed public exploit are present in the input (a POC is likely embedded in the GHSA advisory but is not confirmed here). So this is a genuine high-severity RCE for the specific population running the vulnerable config, but the 10.0 overstates blanket real-world risk: exploitation is gated on both a misconfiguration and an application design that feeds untrusted code to vm2. Treat as high priority for any service that loads untrusted JS in vm2 with require.external enabled; deprioritize elsewhere. Note vm2 is deprecated/unmaintained, which raises exposure for laggards but lowers the count of actively-maintained deployments. |
| Exploit ScenarioDerived | An application uses vm2 to execute untrusted user-supplied JavaScript and has enabled require.external to let sandboxed code load modules, without an explicit require.root excluding node_modules. The attacker submits JS that does require('vm2'), spins up a fresh unrestricted NodeVM, and from it calls child_process to run host OS commands (e.g. spawn a reverse shell). A POC is likely present in the vendor advisory, though not independently confirmed here. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 17, 2026
Sandbox escape leading to remote code execution affects the vm2 Node.js sandbox library before version 3.11.7 when the embedding application enables require.external without an explicit require.root that excludes node_modules. Under that configuration, attacker-supplied JavaScript running inside the sandbox can require vm2's own package, construct an unrestricted NodeVM instance, and then execute arbitrary host OS commands through child_process, yielding a complete escape from the sandbox to the underlying operating system. Exploitation requires two operator-chosen, non-default preconditions (running untrusted code in vm2 AND the permissive require configuration), so deployments that leave require.external disabled or pin require.root away from node_modules are not exposed; no public exploit code was identified at time of analysis, and the vendor-released fix is version 3.11.7.
RemediationAI
Upgrade vm2 to 3.11.7 or later - this is the vendor-released patch for CVE-2026-92946, and it is the only complete fix. If upgrading must be staged, apply the two compensating controls that directly neutralize the escape path: either disable require.external entirely so the sandbox cannot resolve modules outside the built-in set, or set require.root to a dedicated directory that contains only the modules the sandbox legitimately needs and explicitly excludes node_modules (and therefore vm2's own package). The trade-off for both workarounds is functional: applications that rely on sandboxed code loading third-party Node modules will fail to resolve those modules until require.external is re-enabled with a correctly scoped require.root, so any interim configuration should be validated against the sandbox's expected module-loading behavior. Because exploitation depends on attacker-controlled code already reaching the sandbox, also review what gates code submission to vm2 and whether the sandbox is used to run input from untrusted or lower-privileged sources, since removing that exposure eliminates the attack surface regardless of library version. Details are in the GitHub advisory (https://github.com/patriksimek/vm2/security/advisories/GHSA-j3hm-6rg5-mchv) and the VulnCheck advisory (https://www.vulncheck.com/advisories/vm2-before-3.11.7-remote-code-execution-via-require-external).
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 sandbox library designed to execute untrusted JavaScript with restricted access to the host, and it is commonly embedded in plugin systems, CI runners, and multi-tenant JavaScript execution services. The flaw is classified as CWE-913 (Improper Control of Dynamically-Managed Code Resources): when require.external is enabled without an explicit require.root that excludes node_modules, the sandbox's module resolver can reach vm2's own installed package rather than being confined to a safe root. Sandboxed code therefore re-enters the library's own API surface, instantiates a NodeVM without the restrictions the host application intended, and gains the full Node.js runtime, from which child_process provides arbitrary host command execution. The CPE cpe:2.3:a:patriksimek:vm2:*:*:*:*:*:*:*:* covers all released vm2 versions prior to 3.11.7. The supplied CVSS 4.0 vector scores 10.0 with all impact metrics High and subsequent-system scores SC:H/SI:H/SA:H, consistent with an independent assessment of CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H, which rates attack complexity High because both the untrusted-code execution model and the specific require.external/require.root misconfiguration must be present; no user interaction is required beyond the ability to feed JavaScript into the sandbox, and authentication requirements are limited to whatever gate the host application places on that code submission.
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:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Network-reachable sandbox with attacker code and full host RCE (S:C, C/I/A:H, PR:N per vm2 threat model), but AC:H because it depends on the non-default require.external-without-excluding-require.root configuration.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
vm2 before 3.11.7 contains a remote code execution vulnerability when require.external is enabled without an explicit require.root that excludes node_modules. Sandboxed code can require vm2's own package, instantiate an unrestricted NodeVM instance, and execute arbitrary host OS commands via child_process.
Technical POC Analysis
CWE-913: Improper Control of Dynamically-Managed Code Resources.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
A critical sandbox escape in the vm2 Node.js library (versions before 3.11.7) lets attacker-supplied JavaScript break out of its sandbox and execute arbitrary commands on the underlying host operating system, giving an intruder full control of any affected server. Exposure is limited to applications that both run untrusted code inside vm2 and enable the non-default require.external setting without a require.root that excludes node_modules, but where those conditions apply the exposure is total and warrants immediate remediation.
Disable require.external and set require.root to a directory that excludes node_modules so the sandbox cannot load vm2's own package; run untrusted code in a separate low-privilege container or process with no host credentials, read-only filesystems, and restricted egress; monitor for child_process spawning from Node processes as a detection signal. Advisory-named fix is vm2 3.11.7 - validate availability and apply.
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.
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-81595
GHSA-29x6-9qh5-83gg
NVD
CVE.org
EPSS
Exploit-DB