[YMsora]The latest published vm2 release, 3.11.5, and the current main branch are vulnerable to a sandbox escape when used on Node.js 26. An ordinary fulfilled Promise created by an async function can retain an attacker-controlled constructor[Symbol.species] across Promise.prototype.finally().
vm2 installs wrappers on the intrinsic Promise.prototype.then and catch methods. On Node.js 26 / V8 14.6, V8's SetPrototypeProperties path updates these existing data properties without invalidating the PromiseThenLookupChain protector. Promise.prototype.finally() subsequently trusts the stale protector and uses an internal InvokeThen fast path that calls the original native then, bypassing vm2's wrapper and its resetPromiseSpecies(this) hardening.
The attacker-controlled species constructor therefore supplies the resolve and reject functions used by a native Promise reaction. A calibrated stack overflow at that native reaction boundary yields a raw host-realm RangeError to the attacker-controlled reject function. Its constructor chain reaches the host Function constructor and consequently the host process object.
The attached proof is non-destructive: it reads only process.version. It does not execute commands, access files, or perform network requests.
Verified on 2026-08-14:
latest: vm2@3.11.5vm2@3.11.5 publication time: 2026-05-18T15:37:26.138ZgitHead: 7a1f5100b96f48d34e0fe104ab37c0acc5944f92https://registry.npmjs.org/vm2/-/vm2-3.11.5.tgzsha512-RSrkBiwrj6FRU+QdqNs6KG0XdlvJCjpQ4GXiqmMbrhmwfu5k/XIMpAer0L8f6iuf0uJ3a4T1xJN126Q8yf0VIA==main HEAD: the same commit, also tagged v3.11.5v26.7.0, V8 14.6.202.34The npm tarball and current GitHub main contain the same relevant lib/setup-sandbox.js Git blob. There...
3.11.7Exploitability
AV:NAC:LPR:NUI:NScope
S:UImpact
C:HI:HA:H9.8/CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H