vm2 is vulnerable to Sandbox Escape
99
Critical Risk
vm2 sanitizes host errors thrown into the sandbox to strip references to host objects, but the handleException routine in the sandbox setup never inspects the ES2022 Error.cause property. When an embedder-exposed host function throws an error whose cause references a host object such as process, sandbox code reads that unsanitized reference from the caught error. Traversing it reaches host module loading and arbitrary command execution, escaping the sandbox. The fix recursively sanitizes cause on all caught errors alongside the existing SuppressedError and AggregateError handling.
You are affected if you are using a version that falls within the vulnerable range and your application exposes a host function to the sandbox that can throw an error whose cause property references a host object such as process.
vm2 is vulnerable to Sandbox Escape in versions 0.0.1 - 3.11.5.
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