Vulnerability record · CVE-2023-29017 · published 6 April 2023
CVE-2023-29017: vm2 sandbox escape via Error.prepareStackTrace leads to RCE
Vm2 Project · Vm2
vm2, a Node.js sandbox for running untrusted code, mishandled host objects passed to Error.prepareStackTrace when unhandled async errors occurred. This let a sandboxed payload break out of the sandbox and execute code on the host. The flaw is fixed in vm2 3.9.15 and no workarounds exist.
Description
vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules. Prior to version 3.9.15, vm2 was not properly handling host objects passed to `Error.prepareStackTrace` in case of unhandled async errors. A threat actor could bypass the sandbox protections to gain remote code execution rights on the host running the sandbox. This vulnerability was patched in the release of version 3.9.15 of vm2. There are no known workarounds.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Automated analysis
critical priorityCVSS 9.8 with network reachability, no privileges or interaction required, public exploit references and very high EPSS make this an urgent patch.
What it is
vm2, a Node.js sandbox for running untrusted code, mishandled host objects passed to Error.prepareStackTrace when unhandled async errors occurred. This let a sandboxed payload break out of the sandbox and execute code on the host. The flaw is fixed in vm2 3.9.15 and no workarounds exist.
Impact
An attacker who can get code executed inside the sandbox gains remote code execution on the host process running vm2, with full loss of confidentiality, integrity and availability.
Attack surface
Reached over the network with no authentication and no user interaction per the CVSS vector (AV:N/AC:L/PR:N/UI:N); the attacker must be able to supply code that vm2 executes in its sandbox, typically via an application that runs untrusted input.
Exploitation
Not listed in CISA KEV, but public exploit references exist and EPSS is 0.63 (99th percentile), indicating high likelihood of exploitation activity.
What to do
- Upgrade vm2 to version 3.9.15 or later immediately; the patch commit is d534e5785f38307b70d3aac1945260a261a94d50.
- If upgrade is not possible, remove or disable vm2 sandboxing of untrusted code, since no workarounds are documented.
- Treat any host running vm2 as potentially compromised if untrusted code was executed; rotate secrets and review outbound connections.
- Restrict network egress and process privileges for Node.js services that embed vm2 to limit post-exploitation reach.
Detection
- Search dependency manifests and lockfiles for vm2 versions below 3.9.15.
- Monitor Node.js processes for unexpected child process creation or shell execution originating from sandboxed workloads.
- Alert on unhandled async error patterns or Error.prepareStackTrace manipulation in application logs.
- Review outbound network connections from hosts running vm2 for anomalous destinations.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Affected products
1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
Track CVE-2023-29017 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2023-29017), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.