Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconSubmit crafted JavaScript to vm2 sandbox
-
DeliveryInvoke Buffer.prototype.slice with inspect options containing malicious stylize callback
-
ExploitTrigger util.inspect showProxy:true to leak proxy handler into this.seen[1]
-
InstallExtract handler methods (fromOtherWithContext, getFactory, objectWrapper, or direct trap access)
-
C2Reconstruct host-realm Function constructor bypassing prototype isolation
-
ExecuteExecute arbitrary system commands with host process privileges
-
ImpactEstablish persistence or exfiltrate data
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | No special conditions - remote unauthenticated exploitation against default configurations of vm2 versions <3.11.0. Attack vector is network-accessible (AV:N) with low complexity (AC:L), requires no privileges (PR:N), and no user interaction (UI:N). The vulnerability exists in core sandbox isolation logic, not dependent on non-default settings, specific Node.js flags, or particular deployment configurations. Exploitation requires only the ability to submit JavaScript code for execution within a vm2 sandbox, which is the library's intended use case. The Buffer.prototype.inspect harvest mechanism functions on Node.js ≤22 (Node 24+ has inadvertent argument validation mitigation for this specific primitive, but the handler leak architecture remains exploitable via alternative paths). The vendor's test suite demonstrates exploitation succeeds across common deployment scenarios without environment-specific prerequisites. Limiting factor: attacker must have code submission capability to the vm2 sandbox, but this is precisely the use case vm2 advertises (running untrusted third-party code), meaning the attack surface is inherent to the product's security promise, not an edge case configuration. |
| Impact | CRITICAL real-world risk despite absence from CISA KEV. CVSS 9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) accurately reflects exploitability: network-accessible, low complexity, no authentication, no user interaction required. The exploit is fully weaponized with public proof-of-concept code in the GitHub advisory (GHSA-v37h-5mfm-c47c) and repository test suite demonstrating eight working exploitation primitives. Any application accepting untrusted code for evaluation via vm2 <3.11.0 is immediately vulnerable to complete host system compromise. SSVC decision framework: Exploitation=POC, Automatable=YES (can be scripted without human interaction), Technical Impact=Total (full control of host process). The vulnerability's criticality is amplified by vm2's deployment context - it is explicitly marketed as a security boundary for untrusted code execution, meaning adopters are specifically running attacker-controlled input. Contrast with typical code injection: this is not misuse of a general-purpose API but a complete failure of the library's sole security function. The extensive commit history (three separate fixes for eight PoC variants) indicates sophisticated evasion potential and defense difficulty. EPSS data unavailable, but the combination of trivial exploitation, widespread deployment in security-sensitive contexts (plugin systems, online code evaluators, serverless function platforms), and public PoC code makes active exploitation highly probable. Patch adoption is mandatory; no compensating controls exist for a sandbox escape vulnerability - the entire security model depends on the boundary vm2 failed to maintain. |
| Exploit ScenarioDerived | An attacker submits malicious JavaScript code to a web application's plugin system or online code evaluator that uses vm2 for sandboxing. The payload constructs a crafted object combining Buffer.prototype.slice/inspect/hexSlice with a custom stylize callback, then invokes inspect with showProxy:true. The stylize callback harvests the leaked proxy handler from this.seen[1], uses the handler's fromOtherWithContext method to reconstruct a host-realm Function constructor, and executes arbitrary system commands (process spawning, file system access, network connections) with full privileges of the Node.js process. Eight distinct exploitation primitives (objectWrapper write-back, fromOtherWithContext, doPreventExtensions property forgery, getFactory constructor access, direct trap calls, reduce-bind chains, and two handler-class-reconstruction variants) provide redundant attack paths, making automated exploitation trivial. Public PoC code in GHSA-v37h-5mfm-c47c and repository test suite (test/ghsa/GHSA-v37h-5mfm-c47c/harvest-history.js) demonstrates complete sandbox escape extracting process.pid, trivially adapted to reverse shell or data exfiltration payloads. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 04, 2026
Remote code execution in vm2 (Node.js sandbox library) versions prior to 3.11.0 allows unauthenticated attackers to escape the sandbox environment via the inspect function and execute arbitrary system commands. The vulnerability exploits handler leakage through util.inspect's showProxy option to reconstruct host-realm objects and break isolation guarantees. CRITICAL: This is a complete sandbox bypass affecting all deployments using vm2 for untrusted code execution. Vendor-released patch available in version 3.11.0 with multiple commits addressing eight distinct exploitation primitives discovered during iterative disclosure.
RemediationAI
Upgrade immediately to vm2 version 3.11.0 or later (released at https://github.com/patriksimek/vm2/releases/tag/v3.11.0). The patch comprises three commits: 8d30d93213c1898b3e035298b89a814970dd1189 (test coverage for PoCs #1-6), bdd3d15e57bc4ec5e70365cd79f7cb0256e5f88c (core handler isolation fix), and fd266d084e0a3322d0f71ba2a8dc4c96cd030228 (additional hardening). No workarounds exist for a sandbox escape vulnerability - the security model depends entirely on the isolation boundary vm2 failed to enforce. Compensating controls are insufficient: input validation cannot prevent exploitation when the attacker controls code execution within the sandbox, network segmentation only limits post-exploitation lateral movement but does not prevent initial host compromise, and disabling specific Node.js APIs (util.inspect, Buffer methods) breaks legitimate vm2 functionality while attackers demonstrated eight distinct primitives suggesting additional undiscovered paths. Organizations unable to upgrade immediately must migrate to alternative sandboxing solutions (isolated-vm with V8 isolate-level separation, Docker/container-based code execution environments, or WebAssembly sandboxes) or cease accepting untrusted code for execution. Scanning npm dependency trees for 'vm2': <3.11.0 is critical given transitive dependency risk in plugin architectures.
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:2.3:a:patriksimek:vm2) is a popular Node.js library providing sandboxed JavaScript execution environments, widely used for running untrusted code in server-side applications, plugin systems, and code evaluation platforms. The vulnerability stems from CWE-94 (Improper Control of Generation of Code) in the sandbox's isolation boundary. When Node.js's util.inspect function is invoked with showProxy:true on specially crafted objects combining Buffer.prototype methods (slice, inspect, hexSlice) with custom stylize callbacks, the internal proxy handler object leaks into the inspection context's 'this.seen' array. This leaked handler exposes privileged methods (objectWrapper, fromOtherWithContext, doPreventExtensions, getFactory, direct trap access, reduce-bind chains) that can reconstruct host-realm Function constructors, bypassing the sandbox's prototype isolation. The vendor's test suite documents eight distinct exploitation chains (PoCs #1-8) discovered through iterative security research, with commits 8d30d93, bdd3d15, and fd266d0 addressing different primitive access paths. The vulnerability requires Node.js ≤22 to trigger the Buffer.prototype.inspect harvest path; Node 24+ inadvertently mitigates through stricter argument validation, though the underlying architectural flaw exists across all versions before 3.11.0.
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
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
3DescriptionCVE.org
vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.0, VM2 suffers from a sandbox breakout vulnerability through the inspect function. This allows attackers to write code which can escape from the VM2 sandbox and execute arbitrary commands on the host system. This issue has been patched in version 3.11.0.
Executive ViewAI
CVE-2026-24781 is a critical remote code execution vulnerability in the vm2 Node.js sandbox library that allows unauthenticated attackers to completely bypass sandbox isolation and execute arbitrary system commands on affected servers. Organizations using vm2 to execute untrusted code-such as SaaS platforms, automation tools, or multi-tenant applications-face immediate risk of full system compromise without detection or authentication requirements.
Vendor-released patch: version 3.11.0. If immediate patching is not possible: disable vm2 functionality pending upgrade, migrate untrusted code execution to isolated containerized environments with network segmentation, or implement strict network egress controls and system call monitoring to detect exploitation attempts.
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
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
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-26987
GHSA-v37h-5mfm-c47c
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB