Skip to main content

vm2 CVE-2026-100721

| EUVDEUVD-2026-87858 CRITICAL
Incorrect Authorization (CWE-863)
9.5
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Recon
    Submit untrusted code to vm2 sandbox
  2. Delivery
    require allowlisted module 'foo'
  3. Exploit
    require sibling path .../node_modules/foo2/index.js
  4. Install
    prefix passes isPathAllowedForModule check
  5. C2
    sibling loaded via hostRequire
  6. Execute
    top-level code runs in host
  7. Impact
    arbitrary code execution outside sandbox

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization logic validation
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 have configured NodeVM with require.external using a CUSTOM resolver AND context:'host' - this is a non-default deployment mode, which is why the vendor sets AT:P (attack requirement present). There must also be at least one allowlisted external module and a filesystem-adjacent, non-allowlisted sibling package whose resolved path shares the allowlisted module's prefix (e.g. node_modules/foo allowlisted, node_modules/foo2 present; scoped @scope/pkg vs @scope/pkg-evil equally affected). Given those conditions, exploitation needs no authentication or user interaction - the attacker simply supplies untrusted guest code to the sandbox (PR:N/UI:N). Deployments not using the external-module host-passthrough resolver, or without a prefix-sharing sibling package installed, are not exploitable via this vector.

Impact

This is a genuine sandbox-escape-to-RCE in vm2, the class of bug vm2 exists to prevent, so on technical severity it is top-tier. The vendor CVSS 4.0 is 9.5 (AV:N/AC:L/AT:P/PR:N/UI:N with full VC/VI/VA:H and SC/SI/SA:H), and CWE-863 (Incorrect Authorization) matches the description: an unanchored RegExp/startsWith prefix test lets guest code load a prefix-sharing sibling package whose top-level code runs in the host before vm.readonly wrapping. However, the AT:P (Attack Requirement Present) is the pivotal signal and is well-justified: exploitation is NOT default - the embedder must have configured require.external with a custom resolver AND context:'host'. That configuration gate meaningfully narrows real-world exposure and is the main reason the raw 9.5 overstates blanket risk. On exploitation signals, no EPSS score, no CISA KEV entry, and no public POC were provided; a fix is confirmed available from the vendor and the advisory ships regression tests (test/ghsa/GHSA-7q3f-wx44-378m/) that demonstrate the technique, so weaponization is low-effort for a capable attacker even though no in-the-wild use is indicated. Note also a minor source discrepancy: the description attributes the flaw to LegacyResolver.customResolve recording externals without a path boundary, while the linked commit/CHANGELOG describes the fix to LegacyResolver.isPathAllowedForModule's raw startsWith test - these are the two composed layers (specifier-space and filename-space) of the same allowlist and are consistent, not conflicting. Bottom line: real priority for anyone running vm2 with the external-module + host-context configuration; lower urgency for the many deployments that do not use that mode. vm2 is also deprecated upstream, so migration off vm2 is the durable fix.

Exploit ScenarioDerived

An application embeds vm2's NodeVM to run untrusted plugins/user code and has configured require.external with a custom resolver and context:'host', allowlisting a package such as 'foo'. Guest code first requires the allowlisted 'foo', then requires the absolute path of a non-allowlisted sibling like .../node_modules/foo2/index.js, which passes the unanchored prefix check and is loaded via hostRequire, executing the sibling's top-level code in the host process and escaping the sandbox. No public exploit was provided, but vendor regression tests demonstrate the technique.

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

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

Alert me

AnalysisAIv1 – Sep 27, 2026

Sandbox escape leading to arbitrary host code execution in vm2 (the npm sandbox library, CPE cpe:2.3:a:patriksimek:vm2) affects all versions before 3.12.2 when NodeVM is configured with a custom require.external resolver and context: 'host'. Because the resolver records the allowed module directory as an unanchored prefix pattern, untrusted guest code can require an allowlisted package (e.g. foo) and then require a non-allowlisted sibling sharing that prefix (e.g. node_modules/foo2/index.js), whose top-level code is loaded via hostRequire in the host process before vm.readonly wrapping, yielding code execution outside the sandbox. Exploitation requires the non-default host-passthrough external-resolver deployment plus a prefix-sharing sibling package, but needs no authentication or user interaction (CVSS:4.0 9.5, AT:P/PR:N/UI:N; assessed CVSS:3.1 AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H); no public exploit code was identified at time of analysis and the flaw is not in CISA KEV, though the vendor has published patched commits and version 3.12.2.

RemediationAI

Upgrade vm2 to 3.12.2 or later - vendor-released patch: 3.12.2, corresponding to upstream commits https://github.com/patriksimek/vm2/commit/6ac3916da84e060c403e407b6b6318fcc66b0e72 (adds a required path boundary after the module path so foo2 no longer matches foo, including scoped names), https://github.com/patriksimek/vm2/commit/ab4ee7d803e8c80155e9eb3672226bddbca4aa9c and https://github.com/patriksimek/vm2/commit/91034466bfb7f56b95fd48083ec6ca36d058f164; see the advisory at https://github.com/patriksimek/vm2/security/advisories/GHSA-5h3f-q97h-ccvc. If immediate upgrade is impossible, the exposure can be removed by eliminating the specific configuration prerequisite: drop the custom require.external resolver (use the default resolver or a context: 'sandbox' execution mode), or replace custom host-passthrough resolution with an explicit exact-module allowlist that refuses any specifier not matching a normalized, boundary-checked path - the trade-off is broken legitimate external requires in multi-package configurations. A supplemental control is to ensure no non-allowlisted package shares a path prefix with an allowlisted one (no foo2 alongside foo, no pkg-evil alongside pkg) and to audit the installed dependency tree for such siblings; this is a lower-confidence mitigation since any future dependency addition can reintroduce the prefix collision, and it does not protect against separately tracked specifier-space (..) variants of the same resolver weakness. Treat any host that previously ran untrusted guest code under a vulnerable configuration as potentially compromised, since top-level module code of the loaded sibling executes in the host process before sandbox wrapping.

Affected VersionsENISA

vm2 0 <3.12.2

Affected Packages

npm vm2 fix: 3.12.2

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 provides a Node.js sandbox; NodeVM controls module access through require options, including an external allowlist whose resolution can be delegated to a custom resolver. The vulnerability (CWE-863, improper authorization) sits in lib/resolver-compat.js, where LegacyResolver.customResolve stores resolved directories as new RegExp('^' + escapeRegExp(resolvedPath)) and LegacyResolver.isPathAllowedForModule originally authorized loads with a raw path.startsWith(mod.path) containment test. Neither check enforces a path boundary (exact match, trailing separator, or separator as next character), so a request for .../node_modules/foo2/index.js satisfies the prefix .../node_modules/foo, and the node_modules guard on the remainder does not apply because a sibling's remainder (2/index.js) contains no node_modules segment - that guard only blocks genuinely nested dependencies like foo/node_modules/bar. The bypassed path flows into hostRequire, so the sibling package's top-level module code executes in the host process before any vm.readonly export wrapping is applied, converting an allowlist flaw into a full sandbox escape. The vendor's fix anchors the check to a real path boundary and adds regression coverage under test/ghsa/GHSA-7q3f-wx44-378m/ (ATTACKS.md Category 46), composing with the specifier-side fix described as Category 45 and the require.root symlink TOCTOU fix as Category 24. Scoped packages are affected identically (@scope/pkg vs @scope/pkg-evil).

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 (VulnCheck) PRIMARY 9.5 CRITICAL
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
vuln.today AI 9.0 CRITICAL

Untrusted guest code needs no privileges (PR:N) but the non-default custom-resolver + context:'host' precondition warrants AC:H; sandbox escape to host is a scope change (S:C) with full RCE (C/I/A:H).

3.1 AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Red Hat 9.0 CRITICAL

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
High
Subsequent system: Integrity
High
Subsequent system: Availability
High

DescriptionCVE.org

vm2 before 3.12.2 contains an authorization bypass in the NodeVM external-module resolver. When an embedder configures require.external with a custom resolver (and context: 'host'), LegacyResolver.customResolve in lib/resolver-compat.js records the resolved module directory in this.externals as new RegExp('^' + escapeRegExp(resolvedPath)), without requiring a path separator or end-of-string boundary. Untrusted guest code can therefore require the allowlisted module (e.g. foo) and then require the absolute path of a non-allowlisted sibling whose path merely shares the resolved prefix (e.g. .../node_modules/foo2/index.js); the sibling passes isPathAllowedForModule and is loaded through hostRequire, so its top-level code runs in the host process before the exports are wrapped with vm.readonly, resulting in a sandbox escape and arbitrary code execution in the host context.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 4,327 npm packages depend on vm2 (1,159 direct, 3,200 indirect)

Ecosystem-wide dependent count for version 3.12.2.

Technical POC Analysis

CWE-863 (Incorrect Authorization) in LegacyResolver.customResolve in lib/resolver-compat.js.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

CVE-2026-100721 is a critical sandbox-escape vulnerability in the widely used vm2 npm library (all versions before 3.12.2) that can allow untrusted code to break out of the sandbox and execute with the full privileges of the host Node.js process. Exposure is limited to deployments that use vm2's non-default host-passthrough external module resolver, which is typically found in platforms that execute customer- or partner-supplied JavaScript; where present, a successful escape could expose application credentials, data, and any systems reachable from that server. There is no public exploit identified at time of analysis, and a vendor patch is available, so leadership should focus on confirming which services use this configuration and driving the upgrade to completion.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.4%
Top 68% exploitable
Prevalence
Medium
widely-downloaded but deprecated Node.js sandbox library; niche host-resolver config
Threat Intel
1
1 sources
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor CIRCL GitHub

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 No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
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
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

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

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Related Vulnerabilities in vm2 Sandbox Escape and Authorization Bypass

View all 3

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-45411 CRITICAL POC
9.8 May 13

Sandbox escape in vm2 (patriksimek/vm2) versions prior to 3.11.3 enables remote code execution on the host Node.js proce

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

Vendor StatusVendor

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