A critical-severity vulnerability in the vm2 Node.js sandbox library, tracked as CVE-2026-22709, allows escaping the sandbox and executing arbitrary code on the underlying host system. The open-source vm2 library creates a secure context to allow users to execute untrusted JavaScript code that does not have access to the filesystem. vm2 has historically been seen in SaaS platforms that support user script execution, online code runners, chatbots, and open-source projects, being used in more than 200,000 projects on GitHub. The project was discontinued in 2023, though, due to repeated sandbox-escape vulnerabilities, and considered unsafe for running untrusted code. Last October, maintainer Patrik Šimek decided to resurrect the vm2 project and release version 3.10.0 that addressed all vulnerabilities known at the time and "still compatible all the way back to Node 6." The library continues to be very popular on the npm platform, constantly reaching around one million downloads every week for the past year. The latest vulnerability arises from vm2’s failure to properly sandbox ‘Promises’, the component that handles asynchronous operations to make sure code execution is restricted to the context of the isolated environment. While vm2 sanitizes callbacks attached to its own internal Promise implementation, async functions return a global Promise whose .then() and.catch() callbacks are not properly sanitized. "In vm2 for version 3.10.0, Promise.prototype.then Promise.prototype.cat...
Critical sandbox escape flaw found in popular vm2 NodeJS library
BleepingComputer
·Bill Toulas
·Published Jan 27, 2026
·Updated
Affected Software
1 affected component
vm2 vm2<=3.10.0
Frequently Asked Questions
1
What is the main topic of this article?
The article discusses a critical-severity vulnerability in the vm2 Node.js sandbox library.
2
What security implications are discussed in the article?
The vulnerability allows attackers to escape the sandbox and execute arbitrary code on the host system.
3
What is the identifier of the vulnerability mentioned?
The vulnerability is tracked as CVE-2026-22709.
4
What kind of software is affected by this vulnerability?
The affected software is the vm2 Node.js library.
5
When was this security vulnerability published?
The vulnerability was published on January 27, 2026.