Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsLearn about Arbitrary Code Injection vulnerabilities in an interactive lesson.
Start learningUpgrade vm2 to version 3.11.0 or higher.
vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules.
Affected versions of this package are vulnerable to Arbitrary Code Injection through the BaseHandler write traps in lib/bridge.js. An attacker can mutate host Object.prototype, Array.prototype, Function.prototype, and similar intrinsics by supplying a bridge proxy to one of those objects and then using assignment, Object.defineProperty, delete, or Object.preventExtensions from sandbox code. The bridge forwards those operations into the real host object, so attacker-controlled properties become visible to host-side code, existing methods can be removed or replaced, and host prototypes can be frozen to break later property installation and other normal runtime behavior.