/

CVE-2026-92958

Severity:

HIGH RISK

(8.5)

Builtin Denylist Bypass (CWE-269) in vm2 NodeVM Sandbox

CVE-2026-92958

Deferred

Vulnerability type

Category:

Improper Privilege Management

CWE:

CWE-269

Impact:

Sandbox Escape and Unauthorized Filesystem Access

Severity:

HIGH RISK

(8.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

vm2's NodeVM can incorrectly apply builtin-module denylist rules when wildcard access is combined with negative entries. Sandboxed code may bypass restrictions on the filesystem module through fs/promises or node:fs/promises and potentially create, modify, read, or remove host-accessible files.

Affected context

The issue affects vm2 NodeVM configurations that allow builtin modules through a wildcard while attempting to deny selected modules with negative entries. It becomes risky when sandboxed code can invoke module subpaths or alternate node:-prefixed names and the embedder relies on exact-name denylist matching to enforce filesystem restrictions.

Exploit preconditions

  • Attack surface: Code executing inside a vm2 NodeVM sandbox - Required access: The ability to run or influence sandboxed JavaScript - Trigger point: A sandboxed require call targeting fs/promises or

node:fs/promises

  • Configuration condition: Builtin modules are broadly allowed with a wildcard

while filesystem access is denied using entries that do not cover subpaths

  • Why exploitation is possible: Denylist matching treats the denied module

name separately from its filesystem-related subpaths and alternate prefixes

Why this happens

The underlying bug is an incomplete privilege-boundary check in builtin-module filtering. Negative entries are matched against exact module names, so denying fs does not necessarily deny fs/promises, and prefix normalization is inconsistent for node:-qualified names. This maps to CWE-269, Improper Privilege Management, because code operating with reduced sandbox privileges can obtain a capability that the embedder intended to withhold.

Potential impact

  • Sandboxed code may access host-visible filesystem APIs
  • An attacker could create or modify files within the accessible filesystem scope
  • Sensitive files may be read or altered where permissions allow
  • Application data, configuration, or temporary artifacts could be removed or corrupted
  • The sandbox isolation boundary could be weakened and enable further compromise

General mitigation guidance

Mitigation generally focuses on making capability restrictions complete, normalized, and deny-by-default. Secure-by-default configurations can avoid wildcard builtin access and explicitly permit only the modules and subpaths required by the application. Policy logic should normalize node:-prefixed names, account for subpath relationships, and evaluate restrictions before exposing module capabilities. Reducing trust in sandboxed code, isolating filesystem namespaces, restricting host permissions, and running the process with least privilege can limit consequences if a module-filtering mistake occurs.

How teams detect issues like this

Detection can include static analysis for wildcard builtin permissions combined with incomplete negative entries, as well as review of module-resolution and prefix-normalization logic. Code reviews should flag exact-name checks that do not account for subpaths or equivalent module identifiers. Runtime monitoring can alert on sandboxed processes loading filesystem-related modules or performing unexpected file operations. Policy enforcement in CI can require explicit allowlists and tests covering subpaths, aliases, and node:-prefixed names; automated review tools may help identify these patterns.

Sources

SourceLink
github.comgithub.com/patriksimek/vm2/security/advisories/GHSA-6rh5-qq4q-97xh
vulncheck.comvulncheck.com/advisories/vm2-before-3.11.7-denylist-bypass-via-fs-promises

Frequently asked

questions

Exploitability depends on how the NodeVM is exposed. An attacker generally needs

a way to supply or influence JavaScript executed inside the affected sandbox;

the flaw itself does not require a network connection.

The attacker needs code execution within the NodeVM and a configuration that

permits wildcard builtin access while incompletely denying filesystem modules.

The resulting filesystem access is still constrained by the host process's

operating-system permissions.

Use a strict, explicit builtin-module allowlist, deny filesystem subpaths and

equivalent prefixes consistently, and validate the effective permissions before

sandboxed code runs.

Test security policies against module aliases, subpaths, and prefix variants;

apply least-privilege process permissions; and monitor sandboxed code for

unexpected module loading and filesystem activity.

Find out what's already
exploitable in your codebase.