Public research

vm2

CVE-2026-92948 · GHSA-qhwx-74w5-xhxq
`NodeVM` builtin allowlist bypass through `node:test.run()`

Critical, 9.9 · Public source snapshot: November 12, 2026

Original portfolio report · Public advisory · Source reference · CVE record · Public advisory

Shared credits and the scope of my investigation are documented below.

Public security research by Charles Vosburgh (the-vibe-dev).

Mallory is already permitted to run untrusted JavaScript inside a NodeVM whose embedder explicitly allowlists the Node.js node:test builtin. On Node.js 24 and newer, affected vm2 releases let that sandboxed code reach the host test runner through a doubled-prefix module request and pass attacker-controlled Node arguments to run(). The runner then launches a separate, unrestricted Node.js process with the operating-system authority of the application hosting vm2. This is a sandbox escape, not session theft or a direct import of a normally denied module.

The verified public affected range is vm2 >= 3.9.6 and < 3.11.7. Version 3.11.7 fixes the issue. The configuration is not a default NodeVM setup: the embedder must explicitly allow node:test, and the demonstrated path also requires a Node.js runtime whose builtin inventory exposes the relevant scheme-qualified entry.

I reviewed the public advisory, source excerpts, release-boundary evidence, fixing release, preserved reproduction record, and public CVE record. The public reproduction was run against exact vm2 3.11.6 and 3.11.7 on Node.js v24.18.0; this update did not rerun the PoC.

Field Value
Package vm2
Ecosystem npm / Node.js
Severity Critical
CVE CVE-2026-92948 — assigned by VulnCheck CNA and published 2026-09-17
GitHub advisory GHSA-qhwx-74w5-xhxq
CVSS 4.0 9.4 — CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
CVSS 3.1 9.9 — CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Public affected range >= 3.9.6, < 3.11.7
Fixed 3.11.7
Weakness CWE-693 — Protection Mechanism Failure
Public PoC Yes — published with the GHSA
Credit Charles Vosburgh (the-vibe-dev) — reporter in both public records

VulnCheck assigned CVE-2026-92948 and published the CVE record on September 17, 2026. The record references this GHSA, carries the same affected range and fixed release, and credits the-vibe-dev as reporter. At the time of this update, GitHub's repository advisory page still displays “No known CVE.” That is a temporary metadata mismatch in GitHub's UI, not evidence that the public CVE refers to a different issue.

NodeVM lets an application execute JavaScript while controlling which host modules the sandbox may import. A common security model is to expose only a small list of builtins:

require: {
  builtin: ['node:test'],
  external: false
}

Mallory controls JavaScript that the application intentionally runs in the sandbox. The expected security boundary is that the code may use only the approved capability and remains unable to start an unrestricted host process. The sandbox is not expected to make hostile JavaScript safe when arbitrary host capabilities are intentionally exposed, but an explicitly allowlisted module should not silently provide a route around the rest of the module policy.

The published route exposes two linked problems. First, node:test contains a process-creation capability even though its module object can be wrapped as read-only. Second, vm2 strips one node: prefix during lookup, so a doubled-prefix request such as node:node:test can resolve to the stored node:test builtin key.

Security invariant: An allowlisted module must not expose a capability that launches an unrestricted runtime, and equivalent builtin spellings must normalize to one canonical policy identity before lookup.

The complete demonstrated prerequisites are:

  • NodeVM, not merely the basic VM API;
  • an embedder configuration that explicitly allows node:test;
  • Node.js 24 or newer with the builtin inventory used by the public path; and
  • attacker-controlled JavaScript already intended to execute inside the sandbox.

In vm2 3.11.6, lib/builtin.js maintains a hard denylist for especially dangerous builtins. The test family was not denied, so an explicitly approved node:test entry could be registered through the generic host-module path:

builtins.set(key, special ? special : vm => vm.readonly(hostRequire(key)));

Wrapping a module with a read-only proxy protects its object structure, but it does not change what privileged methods on the host module can do.

The second step occurs in lib/setup-node-sandbox.js. vm2 strips one leading node: prefix before builtin lookup:

if (localStringPrototypeStartsWith(filename, 'node:')) {
  id = localStringPrototypeSlice(filename, 5);
  nmod = loadBuiltinModule(id);
}

Mallory requests:

node:node:test

The loader reduces that string to node:test, finds the stored allowlist key, and returns a read-only proxy to the host builtin. On supporting Node.js versions, the host node:test module exposes run() with process isolation and an execArgv option. Supplying a Node argument containing --eval= makes the new process evaluate JavaScript outside the vm2 sandbox.

Mallory therefore does not need direct sandbox access to child_process, fs, process, or module. The privileged behavior is already encapsulated in the explicitly allowlisted host API.

Root cause and version lineage

The security decision was made at the module-name level: if node:test was allowlisted, the entire host module was considered acceptable. But node:test contains a method capable of creating a new runtime with caller-controlled Node arguments. A read-only wrapper does not make that capability safe.

At the same time, builtin identities were not fully canonicalized before policy evaluation, leaving repeated node: spellings as another path through the loader. The issue therefore combines two sandbox design failures: module-level allowlisting did not account for boundary-crossing methods, and policy names did not have one canonical representation.

Public history identifies commit 2353ce60351c50379b8d1daab05812c4db634162, released in vm2 3.9.6, as the loader-architecture change that makes the published doubled-prefix path reachable. Public boundary evidence reports 3.9.5 as the preceding negative control and 3.9.6 as affected.

The fixing commit is 415339f698f0d52d3c5ad358b12b79c8072d5b4b, released in vm2 3.11.7. The 3.11.7 source hardens the builtin/capability boundary so the public import path is denied before the dangerous test-runner capability can be used.

The published GitHub advisory expresses the structured range as:

Affected: >= 3.9.6, <= 3.11.6
Fixed:    3.11.7

Public boundary evidence identifies 3.9.5 as blocked and 3.9.6 as affected. Exact 3.11.6 was reproduced vulnerable, and exact 3.11.7 was reproduced as the fixed import-denial control on Node.js v24.18.0. The advisory description originally referenced reproduction through 3.11.5, while its structured range extends through 3.11.6; the local 3.11.6 run confirms that upper endpoint.

The CVE record expresses the same boundary as >= 3.9.6, < 3.11.7, with 3.11.7 marked unaffected. This report therefore treats the CVE and GHSA as two public identifiers for the same case. GitHub's still-unlinked CVE field does not change that mapping: CVE-2026-92948 directly references GHSA-qhwx-74w5-xhxq as its vendor advisory.

Disclosure timeline

Date Event
2026-08-24 GHSA-qhwx-74w5-xhxq and public PoC published.
2026-08 vm2 3.11.7 published with the fix.
2026-08-26 Exact 3.11.6 and 3.11.7 local controls revalidated on Node.js v24.18.0.
2026-09-17 VulnCheck CNA published CVE-2026-92948, referencing the GHSA and crediting the-vibe-dev.
2026-09-19 GitHub's repository advisory page still showed “No known CVE”; this write-up documented the external CVE mapping.

The narrow demonstrated primitive is execution of attacker-controlled JavaScript in a separate Node.js process outside NodeVM. The spawned process runs with the operating-system authority of the application hosting vm2, so it is no longer constrained by the sandbox's module policy.

flowchart TD
    A[Embedder explicitly allows node:test in NodeVM]
    B[Sandbox requests the reachable scheme-qualified builtin name]
    C[vm2 returns a read-only wrapper around the host test module]
    D[Sandbox calls test.run with attacker-controlled execArgv]
    E[Node.js launches a separate process]
    F[Child process evaluates JavaScript outside vm2]
    A --> B --> C --> D --> E --> F

The child can access files, credentials, environment variables, outbound network access, and other resources available to the host account. The exact downstream impact is determined by the embedding process's privileges; the evidence does not imply authority beyond that account.

A deny-all builtin configuration blocks the route. Public validation also showed that the exact path was unavailable on Node.js 22 because its builtin inventory did not expose the scheme-only node:test entry used here, so runtime-specific builtin inventory matters.

The GitHub advisory rates the issue Critical, CVSS 3.1 9.9. The later VulnCheck CNA record also scores it CVSS 4.0 9.4 and preserves the CVSS 3.1 9.9 score. The explicit allowlist and Node.js runtime requirements should remain visible in severity discussions: they constrain reachability, although they do not reduce the demonstrated host-process impact after the affected sandbox is reached.

The public PoC is attached to GHSA-qhwx-74w5-xhxq and is not duplicated as a separate artifact in this repository.

The published reproduction uses a benign marker to prove that code ran in the spawned host process. It was reproduced locally against exact vm2 3.11.6 on Node.js v24.18.0 and blocked by exact vm2 3.11.7 on the same runtime. No production or third-party service is needed for reproduction.

The preserved controls establish that:

  • the sandbox cannot directly import fs, child_process, module, or process;
  • removing the node:test allowlist entry blocks the capability;
  • the public route depends on the Node.js builtin inventory;
  • 3.11.7 denies the import/capability path before host execution; and
  • the PoC writes only a benign marker rather than invoking a shell or contacting a network service.

These controls distinguish the sandbox escape from a configuration that simply grants direct access to an unrestricted module. Because this update did not rerun the public PoC, the statements above describe the preserved public reproduction record rather than a new execution observation.

Upgrade to vm2 3.11.7 or later and reassess every builtin exposed to untrusted NodeVM code. The shipped fix prevents the public import path from exposing the dangerous test-runner capability.

For sandbox designs generally, treat a builtin allowlist as a capability inventory rather than a package-name list. APIs that launch processes, create workers or runtimes, load native code, or accept interpreter arguments require explicit policy treatment even if the surrounding module object is read-only.

Canonicalize module identifiers before allow/deny evaluation and reject ambiguous or repeated scheme prefixes. If test helpers must be exposed, provide a sandbox-local wrapper that omits run(), process isolation, execArgv, and other host process controls.

Regression tests should include:

  • exact allowed builtin names;
  • repeated node: prefixes;
  • denied builtin controls;
  • process-creating methods reachable from allowed modules;
  • wildcard builtin configurations and node:test/reporters variants;
  • attempts to pass --eval, --require, or --import through test-runner process options; and
  • fixed-version assertions that no child marker is created.

CVE-2026-92948 / GHSA-qhwx-74w5-xhxq demonstrates that sandbox allowlists need to model what an API can do, not merely whether its module name appears benign. In vm2 releases from 3.9.6 through 3.11.6, an explicitly allowed node:test module can expose a host test-runner method capable of launching a new Node.js process with attacker-controlled interpreter arguments on the demonstrated Node.js 24 runtime. A doubled-prefix lookup also shows why builtin identifiers must be canonicalized before policy evaluation. vm2 3.11.7 fixes the public path.

Broader lesson: Read-only is not capability-safe. An immutable reference to a privileged host API can still be enough to cross a sandbox boundary.

References

  • https://github.com/patriksimek/vm2/security/advisories/GHSA-qhwx-74w5-xhxq
  • https://www.cve.org/CVERecord?id=CVE-2026-92948
  • https://nvd.nist.gov/vuln/detail/CVE-2026-92948
  • https://www.vulncheck.com/advisories/vm2-3.9.6-through-3.11.5-sandbox-escape-via-node-test

Credit

Charles Vosburgh (the-vibe-dev) — accepted reporter on GHSA-qhwx-74w5-xhxq and named reporter in the public CVE-2026-92948 record.

Research was AI-assisted for source mapping, hypothesis generation, release comparison, and evidence organization. I performed the final validation, disclosure coordination, severity calibration, and publication review.

Responsible use

This write-up documents a publicly disclosed sandbox vulnerability for defensive research, remediation, regression testing, and authorized assessment. Do not use the public PoC against systems without explicit permission.