Oct 2, 2026·6 min read·25 visits
A path traversal and module allowlist bypass flaw in vm2's legacy resolver allows sandboxed code to load un-allowlisted sibling packages that share a lexical prefix with allowlisted modules.
A module allowlist bypass vulnerability (CVE-2026-92945 / GHSA-7q3f-wx44-378m) was identified in the vm2 sandboxing library prior to version 3.11.7. This flaw permits unauthenticated or untrusted code running within the sandbox environment to bypass explicit module restrictions. When the transitive resolution option is disabled, the system fails to validate file system path boundaries, allowing prefix-sharing sibling directories to be resolved and loaded, thereby escaping intended sandbox restrictions.
The vm2 library is a widely utilized Node.js module designed to execute untrusted code in an isolated sandbox environment. It allows developers to restrict access to built-in modules and selectively whitelist specific external modules. This security boundary is essential for applications that execute user-defined scripts, such as extensibility platforms or serverless execution nodes.
A path validation vulnerability, tracked as CVE-2026-92945, exists in versions of vm2 prior to 3.11.7. This vulnerability permits an attacker executing code inside the sandbox to bypass module restriction rules. Under specific configurations, namely when a module is allowlisted with transitive dependency resolution disabled, the validation engine fails to enforce strict boundaries.
This failure allows sandboxed scripts to import un-allowlisted Node.js packages present on the filesystem if those packages share a lexical name prefix with an allowed module. The weakness is classified under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) and CWE-863 (Incorrect Authorization).
The core weakness is located within the legacy path resolution component of the library, specifically inside lib/resolver-compat.js in the LegacyResolver.isPathAllowedForModule(path, mod) method. This function evaluates whether a target import file path (path) is legally accessible from a currently loaded and authorized module context (mod).
When the sandboxing configurations designate an external module with transitive resolution disabled, vm2 attempts to block the loading of nested or untrusted dependencies. To accomplish this, the legacy resolver validates whether the file system path of the target import begins with the file system path of the authorized module. However, the validation checks prefix containment using character-level matches via the JavaScript String.prototype.startsWith() function.
Because the library evaluates the raw directory string without verifying segment boundaries, it fails to differentiate between subdirectories of an authorized package and distinct sibling directories that share a common naming prefix. For example, if the system allows imports from /app/node_modules/foo, the path /app/node_modules/foo2/index.js satisfies the prefix validation because the character sequence of the allowed path is a subset of the target path.
Furthermore, the secondary security check designed to block transitive modules relies on a regular expression /node_modules/ to identify nested dependency pathways. In prefix-bypass attacks, the remainder string extracted after slicing the allowed prefix (e.g., 2/index.js derived from /app/node_modules/foo2/index.js) does not contain the node_modules directory pattern. Consequently, the resolution is erroneously authenticated as a valid subpath of the allowlisted module, granting access to an unauthorized sibling package.
To understand the exact mechanics of the vulnerability, we can examine the implementation of LegacyResolver.isPathAllowedForModule in the vulnerable versions of vm2. The problematic code path uses an unsafe string-based comparison without confirming the directory separator boundaries.
// Vulnerable Implementation in lib/resolver-compat.js
if (path.startsWith(mod.path)) {
const rem = path.slice(mod.path.length);
if (!/(?:^|[\\/])node_modules(?:$|[\\/])/.test(rem)) return true;
}The patch implemented in version 3.11.7 fixes this logic by introducing strict path boundary validation checks. It requires that the candidate path is either a perfect match of the authorized module's path, or that a filesystem directory separator exists at the boundary marker, which isolates the directory context.
// Patched Implementation in lib/resolver-compat.js
const len = mod.path.length;
if (
path.startsWith(mod.path) &&
(path.length === len || (len > 0 && this.fs.isSeparator(mod.path[len - 1])) || this.fs.isSeparator(path[len]))
) {
const rem = path.slice(len);
if (!/(?:^|[\\\\/])node_modules(?:$|[\\\\/])/.test(rem)) return true;
}This updated logic employs three conditions to guarantee a secure match. The first condition path.length === len handles exact matches of the directory path. The second condition this.fs.isSeparator(mod.path[len - 1]) accommodates cases where the allowed module path string already ends with a trailing separator. The final check this.fs.isSeparator(path[len]) checks the character in the candidate path immediately following the prefix length, confirming that it is a valid directory delimiter.
Exploiting this vulnerability requires specific environment conditions. First, the host application must instantiate the sandbox with transitive dependency resolution disabled for specific allowlisted external packages. An attacker must also have the ability to supply sandboxed code that can execute inside this sandbox.
Furthermore, a prefix-sharing sibling package must exist on the local file system within the target's node module directory structure. For example, if the application has /app/node_modules/foo allowlisted, and a target dependency /app/node_modules/foo2 contains vulnerable code, this layout satisfies the physical requirements.
The attack is executed by invoking a relative import sequence through the authorized package. The sandboxed code invokes a mechanism in the allowlisted package to resolve a relative module path or directly attempts to trigger a loading sequence pointing to a parent sibling directory (e.g., ../foo2).
When the resolver processes the module loading command, the legacy path matching routine incorrectly identifies the target path as part of the allowlisted module foo. This permits the file /app/node_modules/foo2/index.js to execute within the sandbox environment, escaping the intended module allowlist restrictions and allowing execution of arbitrarily defined dependencies.
The security impact of CVE-2026-92945 is rated as Medium on the CVSS v3.1 scale (Base Score: 4.2), and Low on the CVSS v4.0 scale (Base Score: 2.3). The lower scoring is due to the complex attack requirements, which demand the existence of specific sibling packages on the local file system.
In environments where these prerequisites are satisfied, an attacker can escape module sandbox constraints. If a package with a similar name prefix exists on the local disk and exports sensitive functionalities, the sandboxed context can fully leverage those resources. This can result in unauthorized data exposure or escalation of privileges depending on what the sibling package can perform.
For serverless platforms or multi-tenant code-execution engines where dependencies are shared or can be populated by other users, this directory prefix matching bug poses a notable privilege escalation risk. By finding or installing a package with an intersecting prefix name, untrusted code can systematically access system resources.
The primary remediation path for this vulnerability is upgrading the vm2 dependency to version 3.11.7 or higher. This version contains the complete fix that integrates platform-independent filesystem separator checks, resolving the prefix-matching boundary flaw.
For environments where upgrading is not immediately feasible, developers can apply defensive configurations. One primary workaround is to avoid running the sandbox with transitive: false configurations unless path isolation is guaranteed. Alternatively, developers can restrict filesystem layout configurations to prevent sibling directories from sharing prefixes with critical allowlisted libraries.
Using static application security testing (SAST) tools can help identify if code relies on unsafe path parsing operations. Developers should avoid custom startsWith prefix logic for verifying authorization and instead utilize canonicalized paths and directory segment array comparisons to confirm directory containment.
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
vm2 patriksimek | >= 0, < 3.11.7 | 3.11.7 |
| Attribute | Detail |
|---|---|
| Vulnerability ID | CVE-2026-92945 / GHSA-7q3f-wx44-378m |
| CWE ID | CWE-22 (Path Traversal), CWE-863 (Incorrect Authorization) |
| Attack Vector | Network (AV:N) |
| Attack Complexity | High (AC:H) |
| CVSS v3.1 Score | 4.2 (Medium) |
| EPSS Score | 0.00277 (18.25th percentile) |
| Exploit Status | Proof of Concept available |
| CISA KEV Status | Not listed |
The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize elements within the pathname that can cause the pathname to resolve to a location outside of the restricted directory.
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.