vm2 is vulnerable to Sandbox Escape
100
Critical Risk
NodeVM's custom resolver in LegacyResolver.customResolve stores an allowlisted package as a raw ^<path> regex prefix with no path boundary, so resolving foo to .../node_modules/foo also allows siblings such as .../node_modules/foo2/index.js. A {module, path} answer allows the whole search directory. Guest code that requires such a sibling runs its top-level code in the host realm under the default context: 'host', which bypasses the external module allowlist and leads to host code execution. The fix stores resolver answers as boundary matched base paths, allows only the resolved package directory, refuses absolute or ..-bearing module answers, and withdraws an authorization when its load fails.
You are affected if you are using a version that falls within the vulnerable range and you configure NodeVM with a custom require.resolver and an external module allowlist.
vm2 is vulnerable to Sandbox Escape in versions 0.1.0 - 3.12.1.
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
ISO 42001Compliant© All Intel data is openly available and commercially licensed.