vm2 is vulnerable to Remote Code Execution
86
High Risk
The bundled command-line interface runs scripts with NodeVM.file() using require.external but without setting require.root, require.context, or require.builtin. The resolver allows all paths when no root is configured and executes host-realm require(). A script run through the CLI calls require(__filename) to re-execute itself, running its module body in the host Node.js process before any result is proxied back. This grants arbitrary code execution with access to the filesystem, child processes, and environment. The fix gives the CLI a restricted default configuration.
You are affected if you are using a version that falls within the vulnerable range and you execute untrusted scripts through the vm2 command-line interface.
vm2 is vulnerable to Remote Code Execution in versions 0.0.1 - 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