CVE-2026-47686 in vm2info

Summary

by MITRE • 08/18/2026

vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.6, handleException() in lib/setup-sandbox.js sanitizes SuppressedError.error, SuppressedError.suppressed, and AggregateError.errors but does not sanitize Error.cause, allowing sandbox code to obtain a powerful host object such as process from an embedder-exposed host function that throws an error with that object as its cause and then execute arbitrary host commands. This issue is fixed in version 3.11.6.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 08/18/2026

The vulnerability identified in the vm2 library, specifically affecting versions prior to 3.11.6, represents a critical sandbox escape mechanism rooted in incomplete input sanitization within the error handling subsystem. Vm2 serves as an open-source virtual machine and sandboxing solution for Node.js applications, designed to execute untrusted code in an isolated environment separate from the host process. The core security model relies on restricting access to sensitive global objects such as process, require, and other host-level APIs that could allow arbitrary command execution or system compromise if accessed by malicious actors. However, a flaw was discovered in the lib/setup-sandbox.js module where the handleException function failed to properly sanitize all properties of Error objects thrown during code execution within the sandboxed environment.

The technical root cause lies in the selective sanitization strategy employed by the library developers. While the implementation correctly sanitized specific error types including SuppressedError.error, SuppressedError.suppressed, and AggregateError.errors, it neglected to apply similar restrictions to the standard Error.cause property introduced in modern JavaScript environments via the TC39 proposal for error causes. This oversight creates a bypass vector where sandboxed code can exploit the native behavior of JavaScript errors that carry an underlying cause object. When an embedder-exposed host function throws an exception, it may attach sensitive host objects to the error's cause field as part of standard debugging or logging practices. Because vm2 did not sanitize this specific property, these powerful host references remained intact and accessible within the sandbox context after the exception was caught and processed by handleException.

The operational impact of this vulnerability is severe, enabling a complete bypass of the intended isolation boundaries. An attacker with access to execute code within the vm2 sandbox can craft an error object that includes a reference to the Node.js process global in its cause property. By triggering exceptions from host functions or manipulating existing exception flows, the malicious script gains direct programmatic access to the process object. This grants the ability to spawn child processes, read and write files, execute arbitrary system commands, and potentially compromise the underlying server infrastructure. The attack does not require complex exploitation techniques beyond standard JavaScript error handling mechanisms, making it highly reliable and easy to implement against vulnerable instances of vm2.

This flaw is categorized under CWE-78 Improper Neutralization of Special Elements used in an OS Command, as the ultimate result often involves command execution via child_process methods accessible through the leaked process object. Additionally, it aligns with MITRE ATT&CK technique T1059 Command and Scripting Interpreter, specifically regarding abuse of system utilities for lateral movement or persistence once initial access is gained within the sandboxed environment. The vulnerability highlights a common pitfall in security library development where partial sanitization provides a false sense of completeness while leaving specific attack vectors open due to oversight in covering all possible data structures introduced by language updates like ES2022 error causes.

Mitigation for this issue requires immediate upgrading to vm2 version 3.11.6 or later, which includes the necessary patches to sanitize Error.cause properties alongside other error types. Organizations relying on older versions should assess their dependency trees and prioritize patching in environments where untrusted code execution is permitted within virtual machines. In cases where upgrading is not immediately feasible, implementing additional layers of defense such as strict Content Security Policies for Node.js contexts or using alternative sandboxing solutions with more rigorous object graph traversal during exception handling can reduce the risk surface. Regular auditing of third-party dependencies and monitoring for new CVEs related to JavaScript runtime security are essential practices to maintain robust application integrity against evolving exploitation techniques targeting virtualization layers.

Responsible

GitHub M

Reservation

05/19/2026

Disclosure

08/18/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!