CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-92939

CVE-2026-92939: Critical Sandbox Escape via Host Crypto setEngine Native Code Execution in vm2

Amit Schendel
Amit Schendel
Senior Security Researcher

Oct 2, 2026·5 min read·4 visits

Executive Summary (TL;DR)

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.

Vulnerability Overview

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.

Root Cause Analysis

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.

Code Analysis

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 Mechanism & Process Analysis

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.

Security Impact & Attack Vectors

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.

Remediation and Migration

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.

Fix Analysis (1)

Technical Appendix

CVSS Score
9.9/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
EPSS Probability
0.62%
Top 52% most exploited

Affected Systems

Applications utilizing vm2 version 3.11.3 through 3.11.6 with 'crypto' builtin enabled

Affected Versions Detail

Product
Affected Versions
Fixed Version
vm2
patriksimek
>= 3.11.3, <= 3.11.63.11.7
AttributeDetail
CWE IDCWE-114 (Process Control)
Attack VectorNetwork
CVSS v3.19.9 (Critical)
EPSS Score0.00616
Exploit StatusPoC Available
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1211Exploitation for Defense Evasion
Defense Evasion
T1129Shared Modules
Execution
CWE-114
Process Control

References & Sources

  • [1]NVD - CVE-2026-92939 Detail
  • [2]GitHub Security Advisory GHSA-46pr-c5wc-xffx
  • [3]VulnCheck Advisory for CVE-2026-92939

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•37 minutes ago•CVE-2026-92941
10.0

CVE-2026-92941: Sandbox Escape and Process-Wide TLS Trust Store Manipulation in vm2

CVE-2026-92941 is a critical sandbox-escape and trust-manipulation vulnerability in the vm2 library (versions 3.11.3 to 3.11.6). This security flaw allows untrusted code executing within a NodeVM sandbox environment to compromise the global TLS trust store of the host Node.js process. By leveraging a design flaw where the host's native 'tls.setDefaultCACertificates' can be executed via a proxy wrapper, combined with a bridge unwrapping bypass in the 'url' module, an attacker can modify the process-wide default root Certificate Authorities. Consequently, all subsequent outbound TLS/HTTPS clients running on the host thread are forced to trust attacker-signed certificates, facilitating transparent Man-in-the-Middle (MitM) attacks. The vulnerability was resolved in version 3.11.7 of vm2 by introducing built-in member-level sanitization before applying read-only proxy wrappers.

Amit Schendel
Amit Schendel
1 views•10 min read
•about 2 hours ago•CVE-2026-92944
9.8

CVE-2026-92944: Sandbox Escape in vm2 via Stale V8 PromiseThenLookupChain Protector

A critical engine-level reachability failure in Node.js 26 running V8 14.6 allows attackers to escape the vm2 sandbox environment. When consecutive prototype properties are modified using sequential assignments, a V8 optimization bug fails to invalidate the PromiseThenLookupChain protector. By calling Promise.prototype.finally, the attacker bypasses the vm2 wrappers, hijacks the promise reaction using a custom constructor, triggers a calibrated stack overflow to capture a host-realm RangeError, and executes arbitrary shell commands on the host.

Alon Barad
Alon Barad
3 views•8 min read
•about 4 hours ago•CVE-2026-92938
9.9

CVE-2026-92938: Remote Code Execution in vm2 via node:sqlite DatabaseSync Sandbox Escape

CVE-2026-92938 is a critical sandbox escape vulnerability in the vm2 library (versions 3.11.3 through 3.11.6) that allows arbitrary native code execution on the host when the node:sqlite built-in module is loaded inside a sandboxed NodeVM environment.

Amit Schendel
Amit Schendel
6 views•8 min read
•about 5 hours ago•CVE-2026-92937
10.0

CVE-2026-92937: Sandbox Escape leading to Remote Code Execution via Promise Indirection in vm2

CVE-2026-92937 is a critical sandbox escape vulnerability in the `vm2` Node.js library. Due to a logical failure in checking direct invocation targets inside the Proxy bridge, an attacker can register Promise callbacks using `Function.prototype.call` or `Function.prototype.apply` indirection. This bypasses the error sanitization wrappers, delivering raw host error objects directly to sandboxed callbacks and allowing the attacker to escape the sandbox and execute arbitrary shell commands on the host.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 6 hours ago•CVE-2026-92935
9.5

CVE-2026-92935: Remote Code Execution via Array-Shaped Require Config in vm2 NodeVM Sandbox

CVE-2026-92935 is a critical sandbox escape and remote code execution vulnerability in the vm2 library. By supplying an array or exotic object to the require property of NodeVM while nesting is enabled, attackers can bypass security checks, load the host vm2 module, and run arbitrary shell commands on the hosting server.

Alon Barad
Alon Barad
5 views•7 min read
•about 7 hours ago•CVE-2026-92949
4.0

CVE-2026-92949: Sandbox Escape and State Mutation in vm2 via Accessor Property Descriptor Leak

CVE-2026-92949 is a sandbox bypass vulnerability in the vm2 library affecting versions 3.9.6 through 3.11.6. The flaw exists due to a breakdown in the ReadOnlyHandler proxy boundary, allowing sandboxed scripts to obtain direct references to wrapped property setters on frozen host-bound objects, ultimately leading to unauthorized state modification in the host environment. This security failure violates the read-only contract enforced by the sandbox for frozen/readonly objects, though it does not by itself allow a full execution-level realm escape. Due to systemic and structural design difficulties in securing a shared-runtime JavaScript sandbox, the vm2 library has been officially deprecated.

Amit Schendel
Amit Schendel
5 views•7 min read