Code Injection in vm2 - #VU129591
Published: May 4, 2026
vm2
Detailed vulnerability description
The vulnerability allows a remote attacker to execute arbitrary code.
The vulnerability exists due to improper control of code generation in BaseHandler.getPrototypeOf in vm2/lib/bridge.js when processing crafted objects through util.inspect and WebAssembly.compileStreaming. A remote attacker can send specially crafted input to escape the sandbox and execute arbitrary code.
The issue can be triggered by reaching BaseHandler via util.inspect to obtain arbitrary prototypes.