vm2 CVE-2026-44005
CRITICALAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit malicious JS to vm2 endpoint
-
DeliveryChain __lookupGetter__('__proto__') via Buffer.apply
-
ExploitWalk prototype chain to host Object.prototype
-
ExecutionInject malicious property via proxy write trap
-
PersistHost code accesses polluted prototype
-
ImpactExecute arbitrary code as host process
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 | Default vm2 VM or NodeVM configuration is vulnerable-no special features, non-default settings, or specific deployment modes required. The PoC demonstrates exploitation against a freshly instantiated VM instance with default options. Attack requires only the ability to execute attacker-controlled JavaScript within a vm2 sandbox, which is the core intended use case of the library. Specifically, the vulnerable bridge.js implementation exposes Buffer.apply by default, and the __lookupGetter__ method is available on all JavaScript objects, providing the prototype-walking primitive without requiring host-realm constructor access or special sandbox configuration. The CVSS vector AV:N/AC:L/PR:N/UI:N confirms no authentication, user interaction, or network-level prerequisites beyond reaching an endpoint that accepts untrusted code input for vm2 evaluation. Exploitation succeeds against any vm2 version 3.9.6-3.10.5 inclusive, regardless of underlying Node.js version, operating system, or hosting environment. |
| Impact | Critical real-world risk despite vm2 project discontinuation in 2023. CVSS 10.0 (AV:N/AC:L/PR:N/UI:N/S:C) indicates perfect attack conditions: network-accessible, low complexity, no authentication, scope change enabling host system compromise. The CVSS vector is fully supported by technical details-attacker-controlled JavaScript in a default VM instance directly mutates host prototypes, escalating from sandbox to host-realm code execution. Publicly available exploit code exists (working PoC in the advisory demonstrates prototype pollution via Buffer.apply prototype walk), lowering exploitation barrier to script-kiddie level. vm2's use case-executing untrusted third-party code in serverless platforms, CI/CD pipelines, plugin systems, and code playgrounds-means vulnerable deployments expose critical infrastructure. The coordinated v3.11.0 release closing 13 advisories (several full RCE primitives) signals widespread design flaws beyond this single CVE. EPSS data not provided but would likely be moderate-to-high given public exploit, ease of exploitation, and vm2's historical npm download volume (~500k weekly pre-deprecation). No KEV listing at analysis time, likely because vm2 was officially deprecated before CISA evaluation. Real priority: URGENT for any remaining vm2 deployments; organizational risk assessment must identify all vm2 dependencies (direct and transitive) given the library's end-of-life status and availability of superior alternatives like isolated-vm. |
| Exploit ScenarioDerived | An attacker submits malicious JavaScript to a web application using vm2 for server-side code evaluation (e.g., a cloud-based code playground, CI/CD pipeline script runner, or SaaS plugin system). The payload chains __lookupGetter__('__proto__') calls through the exposed Buffer.apply function to walk prototype chains from the sandbox realm to the host's Object.prototype, then uses ordinary property assignment to inject a malicious getter/setter or pollute shared properties. When host-realm code later accesses the polluted prototype chain, the attacker's injected properties execute with host privileges, achieving full sandbox escape and remote code execution on the underlying Node.js server. With publicly available PoC code, attackers require no specialized exploitation knowledge beyond basic JavaScript prototype manipulation skills. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 07, 2026
vm2 npm package versions 3.9.6 through 3.10.5 allow sandbox escape through prototype pollution of host-realm intrinsic objects. Attackers execute arbitrary code by leveraging flawed proxy bridge implementation that writes sandbox mutations directly to shared host Object.prototype, Array.prototype, and Function.prototype instead of isolating changes to the sandbox realm. This vulnerability was patched in vm2 v3.11.0 as part of a coordinated release addressing 13 security advisories. Publicly available exploit code exists with minimal attack complexity (CVSS AC:L) requiring no authentication or user interaction (AV:N/PR:N/UI:N).
RemediationAI
Upgrade to vm2 version 3.11.0 immediately per the vendor advisory at https://github.com/patriksimek/vm2/security/advisories/GHSA-vwrp-x96c-mhwq and release notes at https://github.com/patriksimek/vm2/releases/tag/v3.11.0. However, the vm2 project was officially deprecated in 2023 with maintainers recommending migration to isolated-vm (https://github.com/laverdet/isolated-vm) which provides true V8 isolate-level separation rather than proxy-based realm bridging. Organizations should prioritize full replacement over patching given vm2's end-of-life status and the discovery of 13 concurrent security vulnerabilities in the same release cycle. If immediate migration is not feasible, apply v3.11.0 as a temporary measure and implement defense-in-depth: disable Buffer exposure in VM instances (compromises some legitimate use cases but blocks the PoC's Buffer.apply primitive), run VM-executing Node.js processes under restrictive OS-level sandboxes (seccomp-bpf, AppArmor, or containers with minimal privileges) to limit post-exploitation impact, and implement resource limits via the new bufferAllocLimit option in v3.11.0 to mitigate related DoS vectors. Monitor for prototype pollution side effects by adding runtime checks for unexpected properties on Object.prototype/Array.prototype/Function.prototype. All mitigations except full replacement carry trade-offs: disabling Buffer breaks legitimate use cases, OS sandboxing adds operational complexity, and runtime pollution checks only detect rather than prevent exploitation.
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 is a widely-used npm sandbox library for executing untrusted JavaScript in isolated VM contexts. The vulnerability exploits the realm-bridging proxy implementation in lib/bridge.js. BaseHandler.apply() unwraps sandbox-controlled receivers/arguments with otherFromThis() and directly invokes host functions via otherReflectApply(). Attackers chain __lookupGetter__('__proto__') calls through exposed Buffer.apply to walk from sandbox objects to host-realm intrinsic prototypes (Object.prototype, Array.prototype, Function.prototype). Once holding a proxy to host intrinsics, BaseHandler.set() and BaseHandler.defineProperty() forward writes to the real host objects using otherReflectSet() and otherReflectDefineProperty() without sandbox isolation. CWE-94 (Improper Control of Generation of Code) applies because the proxy bridge fails to enforce realm separation, allowing sandbox code to modify shared prototype chains that affect host-realm execution. The npm CPE pkg:npm/vm2 identifies the affected package; the vulnerability exists in the proxy handler design that was supposed to bridge sandboxed and host realms but instead created a bidirectional mutation channel.
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
AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:H
Primary rating from Vendor (https://github.com/patriksimek/vm2).
CVSS VectorVendor: https://github.com/patriksimek/vm2
DescriptionCVE.org
Summary
vm2's bridge exposes mutable proxies for real host-realm intrinsic prototypes and then forwards sandbox writes into the underlying host objects with otherReflectSet() and otherReflectDefineProperty(), which lets attacker-controlled JavaScript running in a default VM or inherited NodeVM mutate shared host Object.prototype, Array.prototype, and Function.prototype from inside the sandbox.
Details
BaseHandler.apply() unwraps sandbox-controlled receivers and arguments with otherFromThis() / otherFromThisArguments() and then directly invokes the real host function with ret = otherReflectApply(object, context, args), so any default-exposed host function that can surface a prototype getter becomes a prototype-walking primitive (lib/bridge.js:665-676). BaseHandler.get() special-cases __proto__ and returns the host-side descriptor or proxy target prototype, which is enough for the attacker to reuse the host __lookupGetter__('__proto__') accessor repeatedly until the walk lands on host Object.prototype, Array.prototype, or Function.prototype (lib/bridge.js:590-616). Once the attacker has a proxy to a host intrinsic prototype, BaseHandler.set() performs value = otherFromThis(value); return otherReflectSet(object, key, value) === true;, which writes attacker-controlled data directly into the shared host object instead of keeping the mutation sandbox-local; BaseHandler.defineProperty() repeats the same design at otherReflectDefineProperty(object, prop, otherDesc) for descriptor-based writes (lib/bridge.js:641-649, lib/bridge.js:753-774). Existing validation does not stop the attack because the constructor filter only blocks one dangerous-property access pattern, setPrototypeOf() only blocks prototype replacement rather than ordinary property assignment, and containsDangerousConstructor() only protects one later re-unwrapping path instead of the initial host-prototype write sink (lib/bridge.js:494-530, lib/bridge.js:595-610, lib/bridge.js:660-662).
PoC
Run the following code snippet and observe that the value of vm2EscapeMarker is polluted:
const { VM } = require('vm2');
const vm = new VM();
vm.run(`
const g = ({}).__lookupGetter__;
const a = Buffer.apply;
const p = a.apply(g, [Buffer, ['__proto__']]);
const hostObjectProto = p.call(p.call(p.call(p.call(Buffer.of()))));
hostObjectProto.vm2EscapeMarker = 'polluted-object-prototype';
`);
console.log({}.vm2EscapeMarker)Impact
Sandbox escape and prototype pollution.
Executive ViewAI
CVE-2026-44005 is a critical sandbox escape vulnerability in vm2 npm package (versions 3.9.6-3.10.5) that allows unauthenticated remote attackers to execute arbitrary code on systems running affected versions through prototype pollution. Organizations using vm2 for code isolation face immediate risk of complete compromise, as attackers can bypass sandbox restrictions without authentication or user interaction.
Vendor-released patch: vm2 v3.11.0. If immediate patching is impossible, isolate affected vm2 instances to air-gapped environments or restrict network access to trusted internal networks only; disable any external code execution features pending upgrade.
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.
GHSA-vwrp-x96c-mhwq
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB