Oct 2, 2026·5 min read·27 visits
The vm2 sandbox allows unauthenticated execution of arbitrary native code via the crypto.setEngine API when the crypto builtin is permitted, resulting in a full host escape.
A critical sandbox escape vulnerability in the vm2 library allows sandboxed JavaScript code to bypass containment and execute arbitrary native code on the host process. This occurs when the host's builtin crypto module is exposed to the NodeVM environment. Although vm2 implements a read-only proxy layer to restrict direct modifications to host properties, it does not prevent invocation of host-level functions. By calling the crypto.setEngine API with a path to a malicious native library on disk, an attacker can trigger OpenSSL's dynamic module loader. The host's operating system loader immediately runs the dynamic library's initializers/constructors before verifying engine compatibility, leading to remote code execution in the context of the host process.
CVE-2026-92939 is a critical sandbox escape vulnerability in the vm2 npm library affecting versions 3.11.3 through 3.11.6. The flaw manifests when the host Node.js crypto builtin module is permitted within a NodeVM sandbox configuration.
While vm2 wraps exposed host modules in a read-only proxy via its internal vm.readonly() function, this protection is insufficient for callable functions. The read-only wrapper prevents property modification but does not restrict or sanitize the invocation of host-process functions.
By calling crypto.setEngine(), sandboxed code can force the host Node.js process to load a dynamic library from disk. If an attacker can write a file to a location accessible by the host, this mechanism allows arbitrary native code execution and a complete sandbox escape.
The root cause lies in the architectural limitation of the vm.readonly() proxy wrapper and Node.js's delegation of cryptographic engines to OpenSSL. The proxy prevents writing properties back to the host object but still permits invoking properties that are callable functions.
When crypto.setEngine(path) is executed, the string argument is forwarded directly to OpenSSL's internal ENGINE loading mechanism. OpenSSL then requests the host operating system to dynamically load the shared library using platform-specific APIs such as dlopen on POSIX systems or LoadLibrary on Windows.
During this loading phase, the operating system's dynamic linker executes the library's static initializers or constructors immediately. This execution occurs before OpenSSL validates the library's contents or checks for valid engine exports.
Consequently, even if OpenSSL subsequently rejects the library and throws an ERR_CRYPTO_ENGINE_UNKNOWN exception, the malicious payload has already executed with the privileges of the parent Node.js process.
Prior to the fix, vm2 exposed builtin modules directly after wrapping them with vm.readonly() without inspecting their internal methods. This allowed sandboxed code to access the unmitigated crypto.setEngine API directly from the host context.
// Vulnerable pattern in lib/builtin.js
builtins.set(key, vm => vm.readonly(hostRequire(key)));The official patch in commit aa146a77f859325e079f3bfbfe6d8309af483daa implements a sanitization layer called BUILTIN_MEMBER_SANITIZERS. This subsystem strips or overrides dangerous callable methods before the module is exposed to the sandbox.
// Patched mitigation in lib/builtin.js
function sanitizeCryptoModule(mod) {
const copy = Object.assign({}, mod);
copy.setEngine = function setEngine() {
throw new Error('crypto.setEngine is disabled in vm2 sandboxes...');
};
return copy;
}This approach neutralizes the risk by ensuring that calling crypto.setEngine from within the sandbox immediately throws an error within the JS runtime, preventing any lower-level calls to the operating system's loader.
Exploitation of this vulnerability requires two conditions: the sandbox must allow the crypto builtin module, and the attacker must have a method to place a compiled native library on the host filesystem.
The attack path begins with compiling a shared library containing a constructor function. For systems using GCC or Clang, this constructor is defined using __attribute__((constructor)), which triggers code execution during the initialization phase of a library load.
Once the library path is supplied to crypto.setEngine(), the OS dynamic loader maps the library into the host process memory and runs the constructor. The host process eventually catches an unknown engine exception, but by that time, the native payload has already executed.
The impact of CVE-2026-92939 is rated critical with a CVSS v3.1 score of 9.9. Because the execution transitions from the Node.js V8 sandbox into native binary execution, all sandbox restrictions are bypassed completely.
An attacker achieves arbitrary remote code execution (RCE) with the security context and system privileges of the parent Node.js process. This allows unauthorized reading of sensitive environment variables, filesystem manipulation, and establishing outbound network connections.
In environments where untrusted code execution is a core feature, such as serverless function hosting or plugin-based architectures, this flaw completely undermines the multi-tenant isolation boundary.
To address this vulnerability, administrators and developers must upgrade vm2 to version 3.11.7 or later. The patch effectively disables the vulnerable function by replacing it with a stub that throws an exception.
However, because vm2 is now deprecated and has historically had numerous structural sandbox escapes, users should transition to stronger isolation mechanisms. Secure alternatives include running untrusted code in short-lived containers, microVMs, or WebAssembly runtimes.
If upgrading is not immediately possible, configurations must be audited to ensure that the crypto module is not included in the allowed list of builtins for any NodeVM instances.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
vm2 patriksimek | >= 3.11.3, <= 3.11.6 | 3.11.7 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-114 (Process Control) |
| Attack Vector | Network |
| CVSS v3.1 | 9.9 (Critical) |
| EPSS Score | 0.00616 |
| Exploit Status | PoC Available |
| KEV Status | Not Listed |
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.