vm2 is vulnerable to Remote Code Execution
100
Critical Risk
The sandbox bridge sanitizes host error objects that reach sandboxed code, but identity checks on the call target fail when handlers are registered through Function.prototype.call indirection. Using a pattern such as p.then.call(p, undefined, cb), the intercepted target is the host call function rather than the promise handler, so sanitization is skipped. Unsanitized host error objects carrying references to host objects reach the sandbox, allowing code execution with host privileges. The fix closes the call and apply indirection so rejection handlers are sanitized correctly.
You are affected if you are using a version that falls within the vulnerable range and you expose a host-realm Promise to the sandbox that can reject with host-object properties.
vm2 is vulnerable to Remote Code Execution in versions 3.11.6 - 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