Skip to main content

vm2 EUVDEUVD-2026-26987

| CVE-2026-24781 CRITICAL
Code Injection (CWE-94)
2026-05-04 GitHub_M GHSA-v37h-5mfm-c47c
9.8
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Recon
    Submit crafted JavaScript to vm2 sandbox
  2. Delivery
    Invoke Buffer.prototype.slice with inspect options containing malicious stylize callback
  3. Exploit
    Trigger util.inspect showProxy:true to leak proxy handler into this.seen[1]
  4. Install
    Extract handler methods (fromOtherWithContext, getFactory, objectWrapper, or direct trap access)
  5. C2
    Reconstruct host-realm Function constructor bypassing prototype isolation
  6. Execute
    Execute arbitrary system commands with host process privileges
  7. Impact
    Establish 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.

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

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

Alert me

AnalysisAIv1 – 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

vm2 < 3.11.0

Affected Packages

npm vm2 fix: 3.11.0

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

Vendor (GitHub_M) PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Red Hat 8.1 HIGH

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

3
Patch available
May 04, 2026 - 18:32 EUVD
Patch released
May 04, 2026 - 17:16 nvd
Patch available
CVE Published
May 04, 2026 - 16:33 nvd
CRITICAL 9.8

DescriptionCVE.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

Why It Matters

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.

Business Impact: Severe
Compensating Controls

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

EPSS Score
0.1%
Top 67% exploitable
Threat Intel
1
1 source
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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.1%
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
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

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

Attack Technique

Code Injection CRITICAL

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.

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