Skip to main content

vm2 EUVDEUVD-2026-60460

| CVE-2026-47686 CRITICAL
Protection Mechanism Failure (CWE-693)
2026-08-17 https://github.com/patriksimek/vm2 GHSA-m283-3h24-438v
9.9
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. Access
    Submit JavaScript into vm2 sandbox
  2. Delivery
    Invoke embedder host function that throws
  3. Exploit
    Catch host error in sandbox
  4. Execution
    Read unsanitized .cause to reach host process
  5. Persist
    Resolve child_process via mainModule.require
  6. Impact
    Execute arbitrary commands on host

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V15 - Secure Coding and Architecture Protection mechanism completeness
Exploitation Conditions

Exploitation requires that the embedding application expose a host function to the sandbox which throws an Error whose .cause (or an arbitrary own property such as err.detail, or a SuppressedError/AggregateError slot, or the error's prototype chain) references a powerful host object like process, require, or module. The attacker must be able to run JavaScript inside the vm2 sandbox and trigger that host function to throw. Limiting factors: this is not exploitable against a vm2 embedding that never throws host errors carrying live host references, so it depends on embedder coding patterns rather than pure default configuration; however, error chaining via new Error(msg, { cause }) is standard modern Node.js practice in library wrappers, DB adapters, and HTTP clients, making the precondition common in real deployments. No user interaction and no host-side authentication are required beyond the ability to submit sandbox code, which is vm2's intended use case.

Impact

This is a genuine high-priority issue for anyone still running vm2, not a paper-tiger high-CVSS score. The vendor CVSS 3.1 vector (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H = 9.9) reflects a network-reachable, low-complexity, scope-changing full compromise, and a functional PoC confirming host command execution is published - so this is 'publicly available exploit code exists' rather than merely theoretical. The one meaningful limiting factor is the prerequisite: exploitation only works if an embedder-exposed host function throws an Error carrying a host reference (via .cause, an own property, SuppressedError/AggregateError slots, or its prototype). EPSS data was not provided and there is no CISA KEV entry, so there is no evidence of active in-the-wild exploitation despite the severity; treat the risk as high because vm2's entire purpose is running untrusted code and modern error-chaining (new Error(msg, { cause })) is extremely common. Because vm2 is now deprecated, many affected deployments may be unmaintained forks or embedded dependencies that will not receive the fix automatically, which raises practical exposure even a mid-sized operator should treat as urgent.

Exploit ScenarioDerived

An application uses vm2 to execute user-submitted JavaScript and exposes a host helper (e.g., a database or HTTP wrapper) that, on failure, throws new Error('fail', { cause: process }). An attacker submits sandbox code that calls the helper, catches the error, reads e.cause to obtain the live host process object, and executes proc.mainModule.require('child_process').execSync('id') for full RCE. A published PoC (poc_error_cause_escape.js) demonstrates exactly this, and given AV:N/AC:L the attack is reliable and needs no user interaction once the vulnerable helper is reachable.

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

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

Alert me

AnalysisAIv1 – Aug 17, 2026

Sandbox escape to remote code execution in the vm2 Node.js sandbox library (versions <= 3.11.5) arises because handleException() in lib/setup-sandbox.js sanitizes SuppressedError and AggregateError sub-errors but never inspects the ES2022 Error.cause property. Untrusted code running inside the sandbox that catches a host-thrown error carrying a .cause (or other own property) pointing at a host object such as process can dereference it to reach child_process and run arbitrary host commands. A working proof-of-concept demonstrating full RCE is published in the GitHub advisory, and the flaw is fixed in vm2 3.11.6; there is no CISA KEV listing indicating active exploitation.

RemediationAI

Vendor-released patch: upgrade vm2 to 3.11.6, which closes GHSA-m283-3h24-438v by sanitizing Error.cause and other host-reference carriers on all error types (release notes: https://github.com/patriksimek/vm2/releases/tag/3.11.6; advisory: https://github.com/patriksimek/vm2/security/advisories/GHSA-m283-3h24-438v). Note that 3.11.6 also fixes four other advisories (GHSA-cfcw-xp6x-25gj, GHSA-gmc2-2x9w-cgh9, GHSA-m5w8-4gq2-6f8x, GHSA-v836-6xw4-9cx3) and requires no API changes for valid configurations, so upgrading is low-risk. Because vm2 is deprecated, the strongest long-term remediation is migrating off vm2 entirely to an isolate-based sandbox such as isolated-vm or a separate OS/container process boundary. If you cannot patch immediately, the most direct compensating control is to ensure no embedder-exposed host function ever throws an Error that references a live host object: wrap all host functions so they catch internally and rethrow plain, reference-free errors (new Error(String(err.message))), which removes the .cause/own-property escape path at the cost of losing chained error diagnostics passed into the sandbox. Avoid exposing powerful host objects (process, require, module) to sandbox scope at all.

Affected VersionsENISA

vm2 < 3.11.6

Affected Packages

npm vm2 fix: 3.11.6

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 library that runs untrusted JavaScript in a restricted context by proxying and sanitizing objects that cross the sandbox/host boundary. The core defensive routine handleException() is meant to strip live host references out of any error object that propagates from a host function into sandbox catch blocks. It walks the error's prototype chain to detect SuppressedError (ES2024 'using' declarations) and AggregateError, recursing into their .error/.suppressed/.errors[] slots, but it returns all other errors unmodified without checking .cause, other arbitrary own properties, or the carrier's prototype chain. Because Error.cause (ES2022, Node 16.9+) and normal own properties can hold a direct reference to host objects, this is a CWE-693 Protection Mechanism Failure: the sanitization mechanism exists but is incomplete, leaving an unproxied path from sandbox to host. The affected package is pkg:npm/vm2.

Know when Node.js 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 (https://github.com/patriksimek/vm2) PRIMARY 9.9 CRITICAL
AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
vuln.today AI 9.9 CRITICAL

Attacker-supplied sandbox code (PR:L) reliably escapes to full host compromise across the sandbox boundary (S:C, C/I/A:H); AC:L since exploitation is deterministic once the embedder throws a host-referencing error.

3.1 AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Red Hat 9.9 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
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch available
Aug 17, 2026 - 22:03 EUVD
CVE Published
Aug 17, 2026 - 17:32 github-advisory
CRITICAL 9.9

DescriptionCVE.org

Affected: vm2 <= 3.11.3 CVSS 3.1: 9.9 HIGH (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H) CWE: CWE-693 (Protection Mechanism Failure) Prerequisite: Embedder exposes a host function that throws an Error with .cause referencing a powerful host object (e.g., process)

Summary

I found that handleException() in lib/setup-sandbox.js recursively sanitizes sub-errors for SuppressedError and AggregateError, but completely ignores the ES2022 Error.cause property. When sandbox code catches a host-thrown error carrying a .cause that references a host object like process, it can traverse that reference to achieve arbitrary command execution on the host.

The project's own docs/ATTACKS.md (Defense Invariant #3, line 54) explicitly claims Error.cause is sanitized. The implementation does not match this claim.

Root Cause

The handleException function (lines 869-959 of lib/setup-sandbox.js) walks the prototype chain of caught errors looking for SuppressedError and AggregateError. When it finds them, it recursively sanitizes their contained errors (.error, .suppressed, .errors[]). For all other error types, it returns e directly at line 958 without inspecting .cause.

javascript
function handleException(e, visited) {
    e = ensureThis(e);
    if (e === null || (typeof e !== 'object' && typeof e !== 'function')) return e;
    // ... cycle detection ...
    while (proto !== null) {
        if (proto === localSuppressedErrorProto) {
            e.error = handleException(e.error, visited);      // sanitized
            e.suppressed = handleException(e.suppressed, visited); // sanitized
            return e;
        }
        if (proto === localAggregateErrorProto) {
            // sanitizes e.errors[] ...
            return e;
        }
        proto = localReflectGetPrototypeOf(proto);
    }
    return e; // .cause is NEVER checked
}

Error.cause was introduced in ES2022 (Node 16.9+). When handleException was extended to cover SuppressedError (for ES2024 using declarations) and AggregateError, the .cause property was simply overlooked.

Affected Code

  • lib/setup-sandbox.js:869-959, the handleException function (missing .cause handling)
  • lib/setup-sandbox.js:886, ensureThis wraps the error but does not recurse into .cause
  • docs/ATTACKS.md:54, Defense Invariant #3 falsely claims .cause is covered

Reproduction

Embedder code that exposes a function throwing with .cause set to process:

javascript
const { VM } = require('vm2');

const vm = new VM({
    sandbox: {
        hostFn: () => {
            throw new Error('fail', { cause: process });
        }
    }
});

const result = vm.run(`
    try {
        hostFn();
    } catch (e) {
        // .cause is not sanitized, so we get a direct reference to host process
        const proc = e.cause;
        proc.mainModule.require('child_process').execSync('id').toString();
    }
`);

console.log(result);

Verified output:

uid=502(vladimir.tokarev) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),...

Full RCE confirmed.

Impact

Any application using vm2 where an embedder-exposed function throws an Error with .cause referencing a host object is vulnerable. The attacker gains:

  • Full host process access (read/write files, spawn processes, network access)
  • Sandbox escape with changed scope (CVSS S:C)
  • No user interaction required

The prerequisite (embedder throwing with .cause) is increasingly common. Error chaining via new Error('msg', { cause: originalError }) is standard practice in modern Node.js code. Library wrappers, database adapters, and HTTP clients routinely chain errors this way.

Suggested Fix

Add .cause sanitization before the prototype-chain walk, so it applies to all error types:

javascript
function handleException(e, visited) {
    e = ensureThis(e);
    if (e === null || (typeof e !== 'object' && typeof e !== 'function')) return e;
    if (!visited) visited = new LocalWeakMap();
    if (apply(localWeakMapGet, visited, [e])) return e;
    apply(localWeakMapSet, visited, [e, true]);

    // Sanitize .cause on ALL errors (ES2022)
    try {
        if ('cause' in e) {
            e.cause = handleException(e.cause, visited);
        }
    } catch (ex) { /* best effort */ }

    let proto = localReflectGetPrototypeOf(e);
    while (proto !== null) {
        if (proto === localSuppressedErrorProto) {
            e.error = handleException(e.error, visited);
            e.suppressed = handleException(e.suppressed, visited);
            return e;
        }
        if (proto === localAggregateErrorProto) {
            if (localArrayIsArray(e.errors)) {
                for (let i = 0; i < e.errors.length; i++) {
                    e.errors[i] = handleException(e.errors[i], visited);
                }
            }
            return e;
        }
        proto = localReflectGetPrototypeOf(proto);
    }
    return e;
}

docs/ATTACKS.md Defense Invariant #3 should also be updated to reflect reality until this fix ships.

Artifacts

FileRole
poc_error_cause_escape.jsPoC demonstrating sandbox escape to RCE via unsanitized .cause

poc_error_cause_escape.js

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 18 npm packages depend on vm2 (6 direct, 12 indirect)

Ecosystem-wide dependent count for version 3.11.6.

Executive ViewAI

Why It Matters

vm2 Node.js library (versions ≤3.11.5), widely used for executing untrusted code, contains a critical sandbox escape flaw with publicly available exploit code enabling remote code execution on host systems. Organizations using vm2 face immediate compromise risk requiring urgent patching to prevent exploitation.

Business Impact: Severe
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 76% exploitable
Prevalence
Medium
popular but sandbox-specific npm library, now deprecated
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
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 Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
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
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
Very High
Technical Impact
Total

Priority Score

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

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

CVE-2025-68613 HIGH POC
8.8 Dec 19

Remote code execution in n8n's workflow expression evaluation system allows an authenticated user with workflow creation

CVE-2024-41713 CRITICAL POC
9.1 Oct 21

A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could

CVE-2024-55591 CRITICAL POC
9.8 Jan 14

FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote

CVE-2023-44487 HIGH POC
7.5 Oct 10

Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour

CVE-2014-7205 CRITICAL POC
10.0 Oct 08

Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t

CVE-2025-59528 CRITICAL POC
10.0 Sep 22

Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete

CVE-2017-14849 HIGH POC
7.5 Sep 28

Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc

CVE-2017-5941 CRITICAL POC
9.8 Feb 09

An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2014-3744 HIGH POC
7.5 Oct 23

Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi

CVE-2014-9566 HIGH POC
7.5 Mar 10

Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin

CVE-2024-35286 CRITICAL POC
9.8 Oct 21

A vulnerability in NuPoint Messenger (NPM) of Mitel MiCollab through 9.8.0.33 allows an unauthenticated attacker to cond

Vendor StatusVendor

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