Oct 2, 2026·6 min read·23 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-109478 is a network-accessible Denial of Service (DoS) vulnerability in ASP.NET Core caused by inefficient algorithmic complexity (CWE-407) when parsing comma-separated HTTP request headers. Prior to the patch, the internal helper method ParsingHelpers.GetHeaderSplit repeatedly called StringValues.Concat inside a loop iterating over each comma-separated token. Because StringValues allocates a new array of size k + 1 and copies all existing elements upon each concatenation, processing N tokens incurs O(N^2) time and space complexity. An unauthenticated remote attacker can send HTTP requests with headers containing thousands of short, comma-separated values to exhaust CPU cycles and induce severe Garbage Collection (GC) pauses, rendering the web application unresponsive.
CVE-2026-114147 is a high-severity Denial of Service (DoS) vulnerability affecting ASP.NET Core and specifically the Microsoft.AspNetCore.SignalR.StackExchangeRedis scale-out provider across .NET 8.0, 9.0, 10.0, and 11.0 preview releases. The vulnerability originates from a string comparison mismatch between internal per-connection group collections and the centralized Redis channel subscription registry, compounded by a race condition during connection teardown. Remote unauthenticated attackers can exploit this flaw to leave orphaned connection contexts and active Redis pub/sub listeners pinned in memory, leading to unbounded memory exhaustion and application process termination.
CVE-2026-114156 is an improper resolution of path equivalence vulnerability (CWE-41) in Microsoft ASP.NET Core affecting .NET 11.0 preview releases and Microsoft Visual Studio 2026. The vulnerability stems from a discrepancy between how path prefix validation helpers (such as PathString.StartsWithSegments) and downstream routing mechanisms handle alternate path separators and percent-encoded characters. An unauthenticated remote attacker can exploit this mismatch over the network to bypass path-based authorization middleware and access restricted endpoints.
CVE-2026-114157 is a high-severity local privilege escalation and security feature bypass vulnerability affecting ASP.NET Core on Microsoft Windows. The flaw resides in the Kestrel web server's Named Pipes transport layer (Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes) and stems from a race condition (CWE-362) during broken pipe error recovery. When an active connection throws an IOException during handshake acceptance, the connection listener previously disposed of the broken NamedPipeServerStream instance before acquiring a replacement stream from its internal pool. This sequence created a momentary window where zero server instances of the named pipe existed in the Windows Named Pipe File System (NPFS). A local, low-privileged attacker can exploit this timing window to create a named pipe with the identical name and a permissive Discretionary Access Control List (DACL), hijacking subsequent inter-process communications and escalating privileges across security boundaries.
CVE-2026-124194 is a forced authentication and spoofing vulnerability in Microsoft Office Outlook caused by a missing user interface warning before dereferencing remote network paths (CWE-356). By embedding an attacker-controlled Universal Naming Convention (UNC) path within MAPI message properties such as PidLidReminderFileParameter, an unauthenticated remote attacker can force a victim's system to initiate an outbound SMB or WebDAV connection upon opening or previewing a crafted message. This automatic authentication handshake leaks the user's NetNTLMv2 hash, enabling offline password cracking or real-time NTLM relay attacks. The vulnerability was exploited in the wild as a zero-day prior to its remediation in Microsoft's November 2026 Patch Tuesday updates and is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.
CVE-2026-114154 is a high-severity Denial of Service (DoS) and uncontrolled resource consumption vulnerability in the Microsoft.AspNetCore.Server.HttpSys component of ASP.NET Core. When processing an HTTP request that simultaneously contains a chunked Transfer-Encoding header, a Content-Length header, and an explicit X-Content-Length header, the server throws an unhandled ArgumentException during header normalization. In certain versions, subsequent exception handling attempts to dereference a disposed native request context, aborting error response dispatch and leaking unmanaged HTTP.sys request structures.