vm2 is vulnerable to Sandbox Escape
85
High Risk
vm2 wraps Promise.prototype.then and related methods to sanitize values crossing the sandbox boundary, but a V8 optimization merges consecutive prototype assignments without invalidating an internal protector. As a result Promise.prototype.finally() follows a fast path that trusts the stale protector and skips sanitization. Sandboxed code uses a fulfilled promise with a controlled species and a calibrated stack overflow to obtain a host-realm error, reach the host Function constructor, and execute code with host privileges. The fix invalidates the protector correctly and wraps Promise.prototype.finally.
You are affected if you are using a version that falls within the vulnerable range and you run untrusted code on Node.js 26.
vm2 is vulnerable to Sandbox Escape in versions 3.10.2 - 3.11.6.
Upgrade the vm2 library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant