vm2: 22 Critical Sandbox Escapes, Fixed in 3.12.2
If anything outside your trust boundary can get code into vm2, upgrade to 3.12.2 today and plan to move that code out of process; if vm2 only runs your own code, upgrade on a normal cycle.
Must act: Apps that use vm2 to run user-, tenant- or model-supplied JavaScript (plugin systems, rule and template engines, workflow and low-code tools, online code runners, AI agent code tools), directly or through a dependency.
Can relax: Projects where vm2 is a transitive dependency that never evaluates attacker-influenced code; patch it, but no escape is reachable without control of the sandboxed script.
- Find every copy: run npm ls vm2 --all (or pnpm why vm2 / yarn why vm2) in each service and image.
- Upgrade to vm2 3.12.2, forcing transitive copies with an npm overrides (or pnpm/yarn resolutions) entry, then rebuild and redeploy.
- If the sandbox runs code from outside your trust boundary, move it to stronger isolation: a separate low-privilege process or Worker, a container, gVisor or Firecracker, as the vm2 README recommends.