CVE-2026-92947: vm2: Sandboxed code can read and write host-realm memory via Node's shared Buffer pool
vm2 up to 3.11.6 lets sandboxed code read and overwrite host memory through Node's shared Buffer pool. Code run in `VM` can call `Buffer.from([0]).buffer` and get the host's pooled ArrayBuffer. Anyone who runs untrusted code in vm2 is affected. Upgrade to 3.11.7.
Published Oct 5, 2026 · Analysis Oct 25, 2026
What an attacker can do
vm2 exposes Buffer to sandboxed code by default. Node serves small allocations from one shared 64 KB pool: Buffer.allocUnsafe(), Buffer.from(array), Buffer.from(string) and Buffer.concat(). The sandbox and the host both draw from that pool. Sandboxed code can take the pool's underlying ArrayBuffer and view the whole thing.
That means the sandbox sees bytes that neighbouring host buffers hold. Those can be secrets, tokens or request data that the host handled with the functions above. The sandbox can also write to the pool, which changes host buffers in place. The advisory mentions sensitive data exposure and possible denial of service.
The attacker needs only the ability to submit code to a vm2 sandbox. No privileges or user interaction are needed, which is why the vector is network-based with a changed scope. Services that run user scripts, plugins or templates in vm2 are the exposed ones.
Who is affected
All vm2 releases up to and including 3.11.6 are affected, in the default configuration where Buffer is exposed to the sandbox. The proof of concept was tested on 3.11.5. Check your installed version:
npm ls vm2Check transitive dependencies too, since many tools bundle vm2.
vm2
- Ecosystem
- npm
- Affected
- <= 3.11.6
- Fixed in
- 3.11.7
- Check
npm ls vm2
How to fix it
Upgrade to vm2 3.11.7.
npm install [email protected]The advisory and release notes list no workaround. Treat any secret that passed through small Buffer operations in a process running untrusted vm2 code as possibly exposed, and rotate it.
How to tell if you were hit
The attack leaves no log line. Review the sandboxed code you ran for use of .buffer on a Buffer, followed by Buffer.from(x.buffer, 0, x.buffer.byteLength) or typed-array reads over the whole pool. The proof of concept is Buffer.from(Buffer.from([0]).buffer, 0, Buffer.from([0]).buffer.byteLength).toString('ascii'). Search stored user scripts for that pattern. Audit lockfiles for vm2 at 3.11.6 or lower.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
Sandboxed code is able to disclose host memory used by small allocations by Buffer.from, Buffer.concat.
Details
vm2 exposes Buffer object to sandboxed code by default. Small `Buffer` allocations (for example, Buffer.allocUnsafe(), Buffer.from(array), Buffer.from(string), and Buffer.concat()) use the same Buffer pool, which is shared with the sandbox. This allows sandboxed code to disclose host memory used by the functions listed above.
PoC
Tested against [email protected] in the node REPL.
Buffer.from('host-memory-should-not-leak-to-sandbox')
new (require('vm2').VM)().run(`Buffer.from(Buffer.from([0]).buffer, 0, Buffer.from([0]).buffer.byteLength).toString('ascii')`)Impact
Since sandbox acquires an ArrayBuffer that is used by the host, it can disclose sensitive data going through functions mentioned above and even write to these buffers, which can lead to sensitive data exposure and potentially denial-of-service.
Credited to zolbooo.
Questions
- Is vm2 3.11.6 affected by CVE-2026-92947?
Yes. The advisory lists every version up to and including 3.11.6 as vulnerable. The fix shipped in 3.11.7.
- Is there a workaround other than upgrading?
None is documented in the advisory or the 3.11.7 release notes. Upgrading is the only remedy the sources give.
- Can the sandbox change host data or only read it?
Both. The advisory says sandboxed code can write to the shared buffers, not just disclose them. That can corrupt host data and may cause denial of service.
- Is it exploited in the wild?
The sources do not say so, and it is not in CISA's KEV catalog. A public proof of concept is in the advisory.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-93605
vm2 contains a sandbox escape vulnerability
critical10.0Oct 7, 2026CVE-2026-100721
vm2: NodeVM custom resolution bypasses external path boundaries
critical10.0Oct 5, 2026CVE-2026-92934
vm2 sandbox escape to host RCE via revisited host-wrapped AggregateError bypassing Error sanitization cycle short-circuit
critical9.0Oct 5, 2026CVE-2026-92946
vm2: NodeVM `require.external` without an explicit `require.root` grants unrestricted host filesystem access and full RCE
critical10.0Oct 5, 2026CVE-2026-92953
vm2: Default VM can mutate host TypedArray and ArrayBuffer intrinsics after the host-prototype pollution fix
critical10.0Oct 5, 2026CVE-2026-92954
vm2: Host-returned Promise rejection can bypass vm2's unhandled-rejection hardening and terminate the host process
critical8.6Oct 5, 2026
