Oct 2, 2026·6 min read·16 visits
A denylist bypass vulnerability in vm2 <= 3.11.6 allows sandboxed code to bypass security rules by importing unblocked subpath modules like fs/promises, enabling arbitrary write access to the host filesystem.
CVE-2026-92958 is a high-severity sandbox escape and denylist bypass vulnerability within the NodeVM subsystem of the vm2 sandboxing library. When configuring wildcards with negative deny entries, exact-string matches fail to block subpaths like fs/promises. Sandboxed code can import these subpaths to bypass isolation and execute arbitrary filesystem operations on the host.
The Node.js environment exposes various native APIs to execute processes, manipulate filesystems, and run network requests. The vm2 library was designed to run untrusted code within a sandboxed context, isolating execution from sensitive APIs. The NodeVM subclass provides options to explicitly control which built-in modules are accessible to the sandbox environment. Security teams and software developers configured this boundary to protect host systems from arbitrary code execution.
A critical flaw exists in the mechanism that matches requested modules against a configured negative deny list. The denylist validation routine checks only exact string equivalences. This routine fails to recognize when an unblocked flat module path belongs to a blocked family hierarchy. As a result, sandboxed code can import alternative subpath interfaces to execute unrestricted host operations.
The vulnerability is tracked as CVE-2026-92958 and GHSA-6rh5-qq4q-97xh. It allows an attacker with sandbox access to bypass policy enforcement. The issue affects all versions of vm2 up to and including 3.11.6 when negative entries are used alongside wildcard configurations.
To understand this security boundary failure, one must examine how the Node.js module loading system structures built-in capabilities. Node.js built-in modules representing subpaths (such as fs/promises or path/posix) are not properties or submodules of their primary modules. Instead, they exist as distinct, independent flat entries within the runtime's internal list of modules.
The vm2 policy parser in lib/builtin.js processes user-defined blocklists using an exact match paradigm. When an application configures a wildcard permit alongside a negative deny list, the library verifies names literally. For example, denying fs via the -fs token only blocks exact matches against the string fs.
Because fs/promises is evaluated as a separate flat entry, the verification check fails to match -fs. The string -fs/promises is not present in the exclude list, and the prefix checks fail to detect the hierarchy. The parser incorrectly concludes that fs/promises is a permitted module, subsequently loading and exposing it to the sandbox environment.
In addition to the subpath bypass, prefix parsing was inconsistently implemented. An exclusion like -node:fs/promises did not match fs/promises, allowing alternative namespace specifiers to bypass the filter. This discrepancy meant sandbox code could leverage different spellings of the same module path to subvert policy validation.
The vulnerable logic resides in the makeBuiltinsFromLegacyOptions function inside lib/builtin.js. During initial configuration parsing, vm2 loops through the internal list of built-in modules. For each module name, it evaluates whether that name is denied by comparing it against configured negations.
// Vulnerable implementation in vm2 <= 3.11.6
if (builtins.indexOf(`-${name}`) === -1 && builtins.indexOf(`-node:${name}`) === -1) {
addDefaultBuiltin(res, name, hostRequire);
}In this design, if the loop processes the module name fs/promises, the code checks builtins.indexOf('-fs/promises') and builtins.indexOf('-node:fs/promises'). If the developer specified -fs in their configuration array, both conditions evaluate to -1. Consequently, the check passes, and fs/promises is registered via addDefaultBuiltin.
The patched version introduced a dedicated helper, isBuiltinDenied, to handle spelling variations and subpath structures. The revised code strips the protocol prefix and checks the root family identifier if a slash is detected in the specifier string.
// Patched implementation in vm2 3.11.7
function stripNodePrefix(name) {
return name.startsWith('node:') ? name.slice(5) : name;
}
function isBuiltinDenied(builtins, name) {
const bare = stripNodePrefix(name);
// Verify exact name matching
if (builtins.indexOf(`-${bare}`) !== -1 || builtins.indexOf(`-node:${bare}`) !== -1) return true;
// Verify subpath members matching root family
const slash = bare.indexOf('/');
if (slash > 0) {
const family = bare.slice(0, slash);
if (builtins.indexOf(`-${family}`) !== -1 || builtins.indexOf(`-node:${family}`) !== -1) return true;
}
return false;
}The updated verification function blocks subpath execution effectively. If a developer declares -fs, any module name containing fs/ or node:fs/ is evaluated against the root family fs. This lookup identifies the matching negative token and prevents the module from loading.
Exploitation requires that the host application instantiates NodeVM with wildcard permissions and negative constraints. For example, a configuration setting builtin: ['*', '-fs'] intends to permit general system functions while specifically restricting file access. The attacker must possess capabilities to inject and execute arbitrary JavaScript code inside this sandbox instance.
Because the sandbox environment exposes the fs/promises namespace directly, the attacker bypassed the legacy protection layer. The execution code does not require complex sandbox evasion techniques or memory corruption payloads. Instead, standard ECMAScript modules are imported through the normal require mechanism.
The attacker loads fs/promises and uses standard asynchronous methods to interact with the host system. High-impact operations, such as file creation, deletion, and permission modification, can be executed using writeFile, rm, or chmod routines. The sandbox isolation boundary is broken because these actions are executed within the parent process context.
The security impact of CVE-2026-92958 is categorized as high, with a CVSS base score of 8.5. This score reflects the change of scope metric, as sandboxed execution rules are completely bypassed to interact directly with the parent operating system. This vulnerability allows arbitrary write and modification access to the host's filesystem.
Since host operations run with the privilege levels of the parent Node.js process, the impact depends on deployment practices. If the host application runs with administrative or root privileges, the sandboxed code can rewrite system binaries, insert SSH keys, or manipulate configuration files. This capability can be leveraged to establish persistent remote code execution on the server.
While the vulnerability does not directly provide a read channel for data exfiltration within the exploit itself, file writes can be used to redirect sensitive application outputs or inject web shells. Consequently, system integrity and system availability are severely compromised. This issue represents a significant risk for platforms running multi-tenant untrusted scripts.
The primary remediation strategy is upgrading the vm2 dependency to version 3.11.7 or higher. This update replaces the flat comparison checks with the hierarchical validation helper, neutralizing the subpath bypass. Software developers should update their package configurations and run verification tests to ensure the patch is applied.
If upgrading is not immediately possible, applications must implement temporary configuration workarounds. The NodeVM options must be modified to explicitly block all known subpath namespaces in addition to the root module name. A robust mitigation must explicitly list names such as -fs/promises, -path/posix, -path/win32, -stream/promises, and other potential bypass paths.
// Hardened options configuration for legacy setups
const vm = new NodeVM({
require: {
builtin: [
'*',
'-fs', '-fs/promises',
'-child_process',
'-path', '-path/posix', '-path/win32',
'-stream', '-stream/promises', '-stream/web'
]
}
});Due to the persistent discovery of sandbox escape vulnerabilities in vm2 and its official deprecation, security teams should plan a migration strategy. Transitioning to stronger isolation layers, such as isolated containers, WebAssembly sandboxes, or process-level boundaries, is recommended for long-term security.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:L| Product | Affected Versions | Fixed Version |
|---|---|---|
vm2 Patrik Šimek | <= 3.11.6 | 3.11.7 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-269 |
| Attack Vector | Network |
| CVSS v3.1 | 8.5 |
| EPSS Score | 0.00384 |
| Exploit Status | PoC |
| CISA KEV Status | Not Listed |
The software does not properly assign, modify, track, or check privileges, allowing actors to access restricted areas or perform unauthorized operations.
CVE-2026-128087 (GHSA-9264-jvgf-6w2f) is an incorrect behavior order (CWE-696) and improper authorization (CWE-863) vulnerability in the russh Rust SSH library, affecting versions 0.55.0 through 0.65.0. During the initial SSH key exchange (KEX) handshake, the client state machine invokes the client::Handler::kex_done() callback—providing the negotiated raw shared secret bytes—prior to validating the remote server's host key or certificate via check_server_key(). Consequently, an untrusted or rogue SSH server can complete cryptographic key agreement and force a connecting client to execute side-effecting application logic inside kex_done() before the server's identity is checked and rejected.
CVE-2026-128082 (GHSA-6vhm-j9h7-f9gh) is an uncontrolled recursion vulnerability (CWE-674) in AutoMapper, a convention-based object-object mapper for .NET. When mapping nested or self-referential types into destination models that rely on parameterized constructors, C# positional records, or recursive ConstructUsing expressions, AutoMapper evaluates child constructor arguments prior to incrementing the parent's recursion depth counter. This ordering flaw bypasses both explicit MaxDepth limits and the default depth limit of 64. An unauthenticated remote attacker can supply deeply nested input payloads to affected endpoints, exhausting the thread call stack and triggering an uncatchable System.StackOverflowException that terminates the hosting .NET process.
An information exposure vulnerability in the @opentelemetry/instrumentation-http package for OpenTelemetry JavaScript versions 0.204.0 prior to 0.222.0 causes incoming HTTP server spans to record raw, unredacted query string parameters under the url.query attribute. While outgoing client spans applied built-in and user-configured query parameter redaction, incoming server spans bypassed this sanitization completely, resulting in the transmission of sensitive credentials such as pre-signed cloud URLs and API tokens to external observability backends.
CVE-2026-128089 is an uncontrolled resource consumption vulnerability in the dnspython toolkit for Python, affecting all versions prior to 2.9.2. When parsing Well-Known Service (WKS) records from text via dns.rdtypes.IN.WKS.WKS.from_text(), the parser fails to validate that numeric service port identifiers fall within the RFC 1035 valid range of 0 through 65535. An attacker capable of supplying untrusted zone files or RDATA text strings containing an arbitrarily large service port integer can force the parser to allocate an unbounded bitmap array using an inefficient linear append loop, resulting in severe CPU exhaustion, application hangs, or Out-Of-Memory (OOM) process termination.
CVE-2026-126347 (GHSA-5cjw-f85j-cv6r) is an open redirect vulnerability (CWE-601) in Tornado, an asynchronous Python networking library and web framework. The flaw resides in tornado.web.RedirectHandler when dynamic URL redirection templates incorporate unvalidated user input. Due to a parser differential between RFC 3986 (used by Python's urllib.parse.urlsplit) and the WHATWG URL Standard (used by modern web browsers), inputs containing three or more leading slashes bypass Tornado 6.6.0's validation logic, allowing unauthenticated attackers to redirect users to arbitrary external domains.
A Denial of Service (DoS) vulnerability exists in @sveltejs/adapter-node versions 5.5.7 and 6.0.0-next.0 through 6.0.0. When a SvelteKit server route returns a direct response from a fetch() call with a Content-Type of text/event-stream, the Node.js adapter attempts to mutate the response headers to disable proxy buffering. Because headers returned directly by the WHATWG Fetch API carry an immutable guard, this mutation throws an unhandled TypeError, terminating the underlying Node.js process and denying service to all active and subsequent clients.