vm2 sandbox escape via Error.prepareStackTrace host object handling
CVE-2023-29017 is a critical sandbox-escape vulnerability in the vm2 Node.js library prior to version 3.9.15. vm2 is intended to execute untrusted JavaScript in a restricted context with controlled access to Node.js built-in modules. The flaw is caused by improper handling of host objects passed to Error.prepareStackTrace when unhandled asynchronous errors occur. Because these host objects are not safely contained within the sandbox boundary, an attacker running untrusted code inside vm2 can abuse this condition to break out of the sandbox and execute arbitrary code in the host context.
Are you exposed to this one?
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
Impact, mitigation & remediation
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Mitigation
If you can’t patch tonight, do this now.
Remediation
Patch, then assume compromise.
Exploits
1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.
This repository contains two JavaScript proof-of-concept exploits targeting the vm2 sandbox library (version 3.9.14) for Node.js. Both files, 'vm2_3.9.14_exploit_1.js' and 'vm2_3.9.14_exploit_2.js', demonstrate a sandbox escape by abusing the Error object's stack trace preparation mechanism. The exploit leverages JavaScript's dynamic function construction to access the Node.js 'process' object and execute arbitrary system commands via 'child_process.execSync'. The payload in both files attempts to create a file named 'flag' on the host system, proving code execution outside the intended sandbox. The repository is structured as two minimal, standalone exploit scripts, each providing a slightly different approach to trigger the vulnerability. No network endpoints or external services are targeted; the exploit is purely local and demonstrates the risk of running untrusted code in a vulnerable vm2 environment.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
Recent activity
3 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
A previously disclosed vm2 sandbox escape vulnerability referenced as part of a history of similar issues.
A critical vm2 sandbox-escape vulnerability disclosed in April 2023 with publicly available exploit code.
A critical vm2 sandbox escape flaw that could lead to arbitrary code execution on the underlying system.
The version that knows your environment.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.