Horizon Alert
Summary of the vulnerability and why it matters
This advisory details a critical vulnerability in the Node.js vm2 sandbox library, which could allow untrusted code execution within the host process. The issue arises from a specific interaction with WebAssembly JSPI features, enabling a sandbox escape. While the library is not directly internet-facing, its integration into applications means this vulnerability could impact systems running the affected code.
- Code can escape the sandbox to run on the host.
- Affects Node.js applications using the vm2 library.
- Confirm if your applications use vm2 and are exposed.
Attack Path
How an attacker could exploit the issue
An attacker can exploit this vulnerability by executing untrusted code within a Node.js application that uses the vm2 library with asynchronous support enabled. The vulnerability lies in how the library handles Promises when interacting with WebAssembly, allowing crafted code to break out of the sandbox and gain control of the host process.
- No authentication or user interaction needed.
- Execute untrusted code within the sandbox.
- Arbitrary code execution in the host process.
Live Threat
Current exploitation, exposure, and threat context
This vulnerability could allow an attacker to execute arbitrary code within the host Node.js process when untrusted code is run with async support on specific runtimes. This occurs when a Promise in the sandbox interacts with certain JavaScript APIs, bypassing the sandbox's protections.
- Host process code execution.
- Untrusted code bypasses sandbox.
- Compromise of application's environment.
Priority actions
Operational Fix
Recommended remediation, mitigation, and detection steps
This vulnerability in vm2 impacts Node.js applications that execute untrusted code within a sandbox. Application owners and platform teams are likely responsible for managing dependencies like vm2. The first practical step is to identify all instances of vm2 within your codebase, assess their exposure and criticality, and determine the accountable owner before planning remediation.
- Identify application owners and affected code.
- Verify vm2 usage and exposure in applications.
- Plan remediation based on identified risks.