12 Critical Flaws in vm2 Node.js Sandbox Enable Host Takeover
Security researchers disclosed 12 sandbox escape vulnerabilities in vm2, including three with CVSS 10.0 scores. The popular JavaScript isolation library can no longer be trusted to contain untrusted code.
The vm2 JavaScript sandbox library, downloaded millions of times from npm, has been gutted by a dozen critical vulnerabilities that allow malicious code to escape containment and execute on the host system. Three of the flaws carry perfect CVSS 10.0 scores, and the library's fundamental security model is now in question.
Security researchers at Semgrep and others have systematically dismantled vm2's protections, revealing that the library cannot reliably isolate untrusted JavaScript—the one thing it was designed to do.
The Vulnerability Landscape
Here's what's been disclosed:
| CVE | CVSS | Escape Method |
|---|---|---|
| CVE-2026-43997 | 10.0 | Host object access via code injection |
| CVE-2026-44005 | 10.0 | Prototype pollution enablement |
| CVE-2026-44006 | 10.0 | BaseHandler.getPrototypeOf injection |
| CVE-2026-43999 | 9.9 | NodeVM allowlist bypass for child_process |
| CVE-2026-24118 | 9.8 | lookupGetter exploitation |
| CVE-2026-44008 | 9.8 | neutralizeArraySpeciesBatch() abuse |
| CVE-2026-44009 | 9.8 | Null proto exception handling |
| CVE-2026-24781 | 9.8 | inspect function vulnerability |
| CVE-2026-26332 | 9.8 | SuppressedError abuse |
| CVE-2026-24120 | 9.8 | Promise species patch bypass |
| CVE-2026-26956 | 9.8 | Symbol-to-string TypeError trigger |
| CVE-2026-44007 | 9.1 | OS command execution via access controls |
Every single one of these flaws enables remote code execution on the underlying host system.
What vm2 Was Supposed to Do
vm2 exists to run untrusted JavaScript safely by intercepting and proxying JavaScript objects, preventing sandboxed code from reaching the host environment. It's used in CI/CD pipelines, online code execution platforms, and anywhere developers need to evaluate user-supplied code without handing over the keys to the server.
That core promise—that code inside a VM instance cannot reach the host—is now broken across multiple attack vectors.
The Patch Treadmill
The maintainers have released patches, but the disclosure notes are sobering: "new bypasses will likely be discovered in the future." The library has been patched repeatedly, with each fix introducing new attack surfaces:
- Version 3.10.5 patched some flaws but introduced others
- Version 3.11.0 addressed multiple issues but missed edge cases
- Version 3.11.1 caught more escapes
- Version 3.11.2 is the current "secure" release—until the next disclosure
This pattern echoes what we've seen with supply chain attacks on PyPI packages, where the security of upstream dependencies becomes a moving target that defenders can never quite catch.
Who Should Worry
If you're running vm2 in production to isolate untrusted code, you have a fundamental architecture problem. The library's security model has failed publicly and repeatedly. Even if you update to 3.11.2 today, you're trusting that no one finds another bypass before you can patch the next one.
Organizations using vm2 for:
- Online code editors - User-submitted code can now attack your infrastructure
- Plugin systems - Third-party plugins could escalate to full server access
- Automated testing - Malicious test payloads could compromise CI/CD
- Low-code platforms - User-defined automations become RCE vectors
Alternatives and Mitigations
The JavaScript ecosystem has alternative isolation approaches, though none are perfect:
- Process isolation - Run untrusted code in separate OS processes with restricted permissions
- Container isolation - Use Docker or similar with minimal capabilities
- WebAssembly sandboxes - Compile untrusted code to Wasm for stronger isolation
- Deno's permission model - Built-in sandboxing with explicit capability grants
For organizations that must continue using vm2 short-term, update to version 3.11.2 immediately and implement defense-in-depth: network segmentation, minimal process privileges, and monitoring for suspicious system calls.
Why This Matters
vm2's collapse illustrates a broader problem: JavaScript's dynamic nature makes true sandboxing extraordinarily difficult. The language wasn't designed for isolation, and bolt-on solutions keep failing. Organizations building products that execute user code need to revisit their security architecture, because npm packages are not security boundaries.
Related Articles
jsPDF Flaw Lets Attackers Embed Local Files in PDFs
CVE-2025-68428 enables path traversal in the popular JavaScript PDF library, allowing attackers to read arbitrary files from Node.js servers and exfiltrate them via generated documents.
Jan 9, 2026OpenClaw Sandbox Escape Hits CVSS 9.9—Upgrade Before It's Exploited
CVE-2026-41329 lets attackers bypass OpenClaw's sandbox via heartbeat context manipulation, achieving privilege escalation. CVSS 9.9 demands immediate patching.
Apr 21, 2026Protobuf.js RCE Flaw Threatens 50 Million Weekly npm Downloads
Critical code injection vulnerability (GHSA-xq3m-2v4x-88gg, CVSS 9.9) in protobuf.js allows arbitrary JavaScript execution via malicious schemas. Patch now.
Apr 18, 2026Second PraisonAI Sandbox Escape in a Week Scores CVSS 9.9
CVE-2026-39888 bypasses PraisonAI's Python sandbox via exception frame traversal. Attackers chain __traceback__ attributes to reach exec(). Patch to 1.5.115.
Apr 9, 2026