vm2 Sandbox Escape via Prototype Pollution
A vulnerability in vm2 versions 3.9.6 through 3.10.5 allows attacker-controlled JavaScript running in a default VM or inherited NodeVM to mutate shared host prototypes from inside the sandbox, leading to sandbox escape and prototype pollution.
CVE search metadata
CVE search record: CVE-2026-44005. KEV: no. Product: vm2 (3.9.6 - 3.10.5). Brief: vm2 Sandbox Escape via Prototype Pollution. Brief link: https://feed.craftedsignal.io/briefs/2026-05-07-vm2-sandbox-escape/
Triage facts
Revision 2- Applicability
- vm2 (3.9.6 - 3.10.5)
- Evidence
- Unknown
- Severity
- Critical
- Sources
- 1 public source
- Freshness
- Revision 2May 7, 04:07 UTC
- Detection
- 2 rules
- Vulnerabilities
- 1 CVE
Revision history 1 entry · Revision 2
- Revision 2
Repaired a legacy canonical identity collision
Changed: slug
The vm2 library, a popular sandbox environment for Node.js, is vulnerable to a prototype pollution attack. Versions 3.9.6 through 3.10.5 are affected. This vulnerability allows malicious JavaScript code running within the vm2 sandbox to escape the sandbox and modify the prototypes of core JavaScript objects (Object, Array, Function) in the host environment. This is possible due to the library's bridge implementation, which exposes mutable proxies for host-realm intrinsic prototypes, and forwards sandbox writes into the underlying host objects. The vulnerability, identified as CVE-2026-44005, poses a significant risk to applications relying on vm2 for secure code execution, as it can lead to arbitrary code execution in the host environment.
Attack Chain
- Attacker provides malicious JavaScript code to the vm2 sandbox environment.
- The malicious code uses
__lookupGetter__to access the__proto__property of a sandboxed object. - The
BaseHandler.get()function inlib/bridge.jsreturns the host-side descriptor or proxy target prototype for__proto__. - The attacker abuses the host
__lookupGetter__('__proto__')accessor repeatedly, walking up the prototype chain. - This walk eventually leads to a proxy of a host intrinsic prototype, such as
Object.prototype,Array.prototype, orFunction.prototype. - The malicious code uses
BaseHandler.set()orBaseHandler.defineProperty()to write attacker-controlled data into the host intrinsic prototype. otherReflectSetorotherReflectDefinePropertythen propagates the changes to the host environment, bypassing the sandbox.- Successful prototype pollution allows the attacker to execute arbitrary code in the host environment, escaping the vm2 sandbox.
Impact
Successful exploitation of this vulnerability allows an attacker to escape the vm2 sandbox and pollute the prototypes of core JavaScript objects in the host environment. This can lead to a variety of consequences, including arbitrary code execution in the host process. This vulnerability affects applications using vm2 versions 3.9.6 through 3.10.5, potentially impacting a wide range of systems that rely on sandboxed JavaScript execution. The prototype pollution can compromise the integrity and security of the host application.
Recommendation
- Upgrade to a patched version of vm2 that addresses CVE-2026-44005.
- Monitor for attempts to access
__proto__via__lookupGetter__within vm2 sandboxes using theDetect VM2 Prototype AccessSigma rule. - Implement additional input validation and sanitization to prevent malicious JavaScript code from being executed in the vm2 sandbox.
- Consider alternative sandboxing solutions or code review practices to mitigate the risk of sandbox escape vulnerabilities.
Detection coverage 2
Detect VM2 Prototype Access
highDetects attempts to access the __proto__ property within a vm2 sandbox, which may indicate a prototype pollution attack.
Detect VM2 Prototype Modification
criticalDetects modifications to the Object.prototype, Array.prototype, or Function.prototype within a vm2 sandbox.
Detection queries are available on the platform. Get full rules →