Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit JavaScript to vm2 sandbox
-
DeliveryCall require('fs/promises') bypassing -fs denylist
-
ExploitReach promise-based filesystem API
-
ExecutionInvoke fsp.writeFile/rm/rename on host
-
ImpactModify or destroy host files
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V8 - Authorization Least privilege enforcement
MITRE ATT&CK
1 technique across 1 tactic: Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires the embedder to configure NodeVM with the builtin wildcard combined with negative denylist entries - specifically a pattern like require: { builtin: ['*', '-fs', '-child_process'] } - because exact-name matching in lib/builtin.js leaves subpath modules (fs/promises, node:fs/promises) reachable. It also requires the fundamental vm2 deployment mode of executing attacker-controlled/untrusted JavaScript in the sandbox. It does NOT trigger on default configurations or on allowlist-style builtin restrictions; deployments that omit fs from an allowlist entirely, or that never use wildcard-plus-negative denylists, are not exposed. No user interaction and no host authentication beyond the ability to run sandbox code are needed. |
| Impact | The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:N, VI:H/VA:L, SI:H/SA:L) scores 8.4 (High), reflecting network-reachable, low-complexity code execution against the host filesystem. However, this rating must be read through vm2's threat model: vm2 exists to run UNTRUSTED JavaScript, so the 'attacker' is simply anyone who can submit script to the sandbox - meaning the practical privilege barrier is even lower than PR:L implies (arguably PR:N). The real gating factor is CONFIGURATION, not exploitation difficulty: the flaw only triggers when the embedder uses the builtin wildcard WITH negative entries (e.g. builtin: ['*', '-fs', ...]), a deliberate non-default denylist pattern. No EPSS score, no CISA KEV entry, and no independent POC feed are present in the input, so there is no evidence of at-scale automated exploitation; the risk is realistic-but-conditional rather than mass-exploited. One conflict to flag: the vendor set VC:N (no confidentiality impact), yet the description explicitly states read operations via fs/promises are also reachable - confidentiality IS affected, so the vendor vector likely understates C. Net: a genuine, high-impact sandbox-escape class issue for the specific denylist configuration, but its blast radius is bounded by how many deployments use wildcard-plus-negative builtin lists. |
| Exploit ScenarioDerived | An application embeds vm2's NodeVM to run user-supplied JavaScript and hardens it with a denylist like require: { builtin: ['*', '-fs', '-child_process'] }, believing filesystem access is blocked. An attacker submits sandboxed code that calls require('fs/promises') (or require('node:fs/promises')), which the exact-name denylist never removed, and invokes fsp.writeFile() to create/overwrite files on the host. The advisory confirms host file creation and writing were demonstrated, so working exploit technique is publicly documented. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 17, 2026
Sandbox escape in vm2 through 3.11.6 lets untrusted JavaScript executing inside a NodeVM bypass the configured builtin-module denylist and reach the host filesystem via require('fs/promises') or require('node:fs/promises'), allowing host file creation and modification (confirmed through fsp.writeFile()) plus cp, mkdir, rename, rm, rmdir, truncate and read operations on the host. Exposure is configuration-dependent: only embedders that combine the builtin wildcard with negative entries (for example require: { builtin: ['*', '-fs', '-child_process'] }) are affected, while default configurations and allowlist-style restrictions are not, and no public exploit identified at time of analysis. The flaw is fixed in vm2 3.11.7. Note that the supplied CVSS 4.0 vector carries PR:L while the independent assessment's CVSS 3.1 vector carries PR:N, so authentication requirements are not unambiguously confirmed from available data; exploitation in practice requires only the pre-existing ability to submit sandboxed code.
RemediationAI
Vendor-released patch: upgrade to vm2 3.11.7, which corrects the denylist matching so that negative entries applied alongside the builtin wildcard also cover subpath and node:-prefixed builtins; the advisory at https://github.com/patriksimek/vm2/security/advisories/GHSA-6rh5-qq4q-97xh and the VulnCheck advisory at https://www.vulncheck.com/advisories/vm2-before-3.11.7-denylist-bypass-via-fs-promises should be consulted for upgrade guidance. Where an immediate upgrade is not possible, the highest-value compensating control is to stop using wildcard-plus-negative denylist patterns and instead pass an explicit allowlist of the builtins the sandbox genuinely needs, deliberately excluding fs and child_process as well as their fs/promises, node:fs and node:fs/promises variants; the trade-off is that allowlists are brittle and will break sandboxed code that legitimately relies on additional builtins, so each code path must be regression-tested. Embedders who must keep the denylist shape can explicitly deny the subpath identifiers ('-fs/promises', '-node:fs/promises', '-node:fs', and related subpaths) in addition to '-fs', accepting that this remains an enumeration-based mitigation that can be bypassed by any subpath the maintainers did not anticipate. Because vm2 executes untrusted code with the privileges of the host process, defense in depth should be applied at the process boundary rather than inside the sandbox: run the vm2 host in a dedicated low-privilege account or ephemeral container with a read-only root filesystem and no unnecessary mounts, and apply seccomp/AppArmor restrictions - with the trade-off that these controls constrain legitimate host I/O the application may depend on and require environment-specific tuning. Note that the absence of a documented patch is not the case here; 3.11.7 is available and should be the primary action.
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 (CPE cpe:2.3:a:patriksimek:vm2:*:*:*:*:*:*:*:*, reported by VulnCheck, tagged Privilege Escalation) is a widely used third-party sandbox that runs untrusted JavaScript inside a Node.js host process, typically through the NodeVM class, and is commonly trusted to confine user-supplied code so it cannot touch the host. Its builtin-module policy is implemented in lib/builtin.js, where wildcard entries such as '*' are expanded and negative entries such as '-fs' are then applied by comparing the requested module identifier against the negative entry using exact module-name matching. Because Node.js exposes subpath builtins (fs/promises, and the node:-prefixed form node:fs/promises) as distinct module identifiers, denying 'fs' removes only the bare 'fs' builtin and leaves the promise-based filesystem surface reachable; the node: prefix is normalized inconsistently, so a '-node:fs/promises' entry likewise fails to block require('fs/promises'). The root cause belongs to CWE-269 (Improper Privilege Management): the sandbox's privilege-restriction mechanism does not cover the full module namespace, so the sandboxed principal silently acquires the host process's filesystem privileges instead of the reduced privileges the embedder intended to grant. Severity signals diverge across sources - the supplied CVSS 4.0 vector is 8.4 (AV:N/AC:L/AT:N/PR:L/UI:N, VI:H/VA:L, SI:H/SA:L) while the independent assessment scores CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L - but both agree the escape yields high integrity impact on files reachable by the host process, with confidentiality impact (host file reads via fs/promises) also achievable. Deployment reachability, not exploit sophistication, is the limiting factor: the bug does not trigger on default configurations or on allowlist-style builtin restrictions, only on wildcard-plus-negative denylist patterns combined with the fundamental vm2 use case of executing attacker-controlled JavaScript in the sandbox.
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:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:H/SA:L
vm2 accepts untrusted script so PR:N; sandbox-to-host escape is S:C; fs/promises grants host read (C:H) and write/delete (I:H), with A:L for file destruction.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
vm2 through 3.11.6 contains a builtin-module denylist bypass in NodeVM. When the embedder uses the builtin wildcard together with negative entries (e.g. require: { builtin: ['*', '-fs', '-child_process'] }), negative entries are matched by exact module name in lib/builtin.js, so -fs removes only the builtin named fs and does not remove builtin subpaths such as fs/promises. Sandboxed code can therefore call require('fs/promises') or require('node:fs/promises') and reach the promise-based filesystem API despite fs being denied; node: prefix handling is likewise inconsistent (a -node:fs/promises entry does not block require('fs/promises')). Host file creation and writing were confirmed via fsp.writeFile(), and other fs/promises operations (cp, mkdir, rename, rm, rmdir, truncate, read operations, etc.) are also reachable. This issue is fixed in vm2 3.11.7.
Technical POC Analysis
The flaw is an incomplete denylist match in vm2's builtin-module resolution.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Latest POC
1 public PoC link from github
Sign in to open the public PoC links collected for this CVE.
Executive ViewAI
Organizations using vm2 through 3.11.6 to sandbox untrusted JavaScript face a high-severity sandbox escape that, under specific non-default configurations, allows code to reach the host filesystem for file creation, modification, and deletion. This undermines the isolation boundary that applications rely on to safely execute third-party or user-supplied code, potentially leading to data tampering, service disruption, or unauthorized system changes. No public exploit identified at time of analysis, but affected embedders should treat the risk as material because the flaw is fixed only in vm2 3.11.7 and requires configuration review to confirm exposure.
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
Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.
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-81607
GHSA-6rh5-qq4q-97xh
NVD
CVE.org
EPSS
Exploit-DB