Skip to main content
COSMICBYTEZLABS
NewsSecurityHOWTOsToolsTraining
StudyProjectsNewsletterHire MeAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Training
Study
Projects
Newsletter
Hire Me
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

1451+ Articles
151+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Checklists
  • Projects
  • Exam Prep

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

System Status: Operational
  1. Home
  2. Security
  3. CVE-2026-47208: vm2 General Sandbox Breakout — Arbitrary Host Execution (CVSS 10.0)
CVE-2026-47208: vm2 General Sandbox Breakout — Arbitrary Host Execution (CVSS 10.0)

Critical Security Alert

This vulnerability is actively being exploited. Immediate action is recommended.

SECURITYCRITICALCVE-2026-47208

CVE-2026-47208: vm2 General Sandbox Breakout — Arbitrary Host Execution (CVSS 10.0)

A CVSS 10.0 critical vulnerability in vm2 for Node.js allows sandbox code to escape and execute arbitrary OS commands on the host system. Patched in vm2 3.11.4.

Dylan H.

Security Team

June 13, 2026
6 min read

Affected Products

  • vm2 Node.js sandbox library — all versions prior to 3.11.4

CVE-2026-47208: vm2 General Sandbox Breakout

CVE-2026-47208 is one of four maximum-severity sandbox escape vulnerabilities disclosed simultaneously in vm2, the Node.js sandbox library used across the npm ecosystem. With a CVSS v3.1 score of 10.0 (Critical), this vulnerability allows attackers to write code that escapes from the vm2 sandbox and executes arbitrary commands on the host system.

Unlike the other three CVEs in this group (CVE-2026-47131, CVE-2026-47137, CVE-2026-47140) which each identify a specific technical vector, CVE-2026-47208 documents a general sandbox breakout condition — an additional escape mechanism not accounted for by any of the prior fixes. All four vulnerabilities are patched together in vm2 version 3.11.4.


Vulnerability Overview

AttributeValue
CVE IDCVE-2026-47208
CVSS Score10.0 (Critical)
Affected Softwarevm2 Node.js sandbox — all versions < 3.11.4
Attack VectorLocal (sandboxed code execution)
Authentication RequiredNone
Primary ImpactSandbox breakout and arbitrary host OS command execution
SourceNVD / NIST (published 2026-06-12)
FixUpgrade to vm2 3.11.4

The vm2 Sandbox and Its Security Model

vm2 is built on Node.js's built-in vm module (which uses V8 isolates) and adds a JavaScript proxy-based hardening layer intended to:

  1. Prevent sandboxed code from accessing host-realm objects
  2. Control which Node.js modules can be require()d from inside the sandbox
  3. Intercept property access that might leak host-realm references

The security model relies heavily on JavaScript Proxy objects and careful object wrapping to maintain the boundary between sandbox and host realms.


Why vm2 Is Fundamentally Difficult to Harden

CVE-2026-47208 is representative of a deeper challenge: JavaScript-level sandboxing is not a security boundary. The fundamental reason is that JavaScript's language semantics provide numerous legitimate pathways between execution contexts that are difficult to enumerate and block exhaustively:

  • Prototype chains traverse the entire JavaScript realm (see CVE-2026-47131)
  • Error constructors carry host-realm type references
  • Global built-ins can serve as bridges to the host context
  • V8 inspector APIs operate across sandbox boundaries by design
  • Proxy handler escape can occur when wrapped objects interact with native C++ code
  • WeakRef and FinalizationRegistry behaviors can expose GC-time host callbacks

A pure JavaScript sandbox (as vm2 implements) must intercept every such pathway — a task that becomes harder with every new JavaScript or Node.js feature.


Impact Assessment

Impact AreaDescription
Arbitrary OS Command ExecutionSandboxed code can run any host OS command with Node.js process privileges
Complete Confidentiality LossHost filesystem, secrets, environment variables fully accessible
Data IntegrityAttacker can write, modify, or delete files on the host
Service Availabilityprocess.exit() or resource exhaustion attacks from within sandbox
Lateral MovementAccess to host network, credentials, and infrastructure from sandboxed context
Multi-tenant BreachOn SaaS platforms, one tenant's sandboxed code can access another's data

The CVSS 10.0 score reflects:

  • Attack Vector: Local (attacker must be able to run code inside the sandbox — but this is precisely the intended use case)
  • Attack Complexity: Low
  • Privileges Required: None (within the sandbox context)
  • User Interaction: None
  • All three impact dimensions: High

Who Is Affected

Directly Vulnerable

  • Any Node.js application using vm2 < 3.11.4 to execute untrusted code
  • Online code execution platforms (REPLs, coding challenges, CTF platforms)
  • SaaS platforms supporting user-defined scripts, plugins, or automations
  • CI/CD systems executing user-submitted build scripts
  • Configuration systems evaluating JavaScript config files from external sources

Check Your Exposure

# Check direct dependency
npm list vm2
 
# Check all transitive dependencies
npm ls --all vm2
 
# Audit for known vulnerabilities
npm audit
 
# Find all uses of vm2 in your codebase
grep -r "require('vm2')\|require(\"vm2\")\|from 'vm2'\|from \"vm2\"" . \
  --include="*.js" --include="*.ts" --include="*.mjs"

Remediation

Primary Fix: Upgrade to vm2 3.11.4

# npm
npm install vm2@latest
 
# yarn
yarn upgrade vm2
 
# pnpm
pnpm update vm2
 
# Verify the fix
node -e "const {VM}=require('vm2'); console.log('vm2 version:', require('vm2/package.json').version)"

If You Cannot Upgrade Immediately

Temporary mitigations (not a replacement for patching):

  1. Wrap vm2 in a container — Run the vm2 process in a Docker container with minimal permissions:

    FROM node:20-alpine
    RUN adduser -D sandboxuser
    USER sandboxuser
    # Drop all Linux capabilities, use read-only filesystem
  2. Apply seccomp profile — Restrict syscalls to what the sandbox legitimately needs:

    docker run --security-opt seccomp=/path/to/node-sandbox-seccomp.json myimage
  3. Use Node.js --experimental-permission (Node.js 20+):

    node --experimental-permission \
         --allow-fs-read=/tmp/safe \
         --allow-child-process=false \
         your-script.js
  4. Rate limit and monitor sandbox executions for anomalous behavior (unexpected syscalls, network connections, file access).

Long-Term: Migrate Away from Pure JavaScript Sandboxing

AlternativeMechanismSecurity Model
isolated-vmV8 isolates via C++ addonTrue V8 context isolation; no shared prototype chain
DenoDeno runtime with permissionsOS-level permission model; deny by default
Firecracker microVMsFull VM isolationHardware-level isolation; highest security
WebAssembly (Wasm)Linear memory, no DOM/Node accessMemory-safe; no native API access by default
Worker Threads + PermissionsNode.js 20+ permission modelBuilt-in allowlist for fs/network/child-process

The vm2 Security History: A Pattern of Recurring Escapes

vm2 has a well-documented history of sandbox escape CVEs:

YearCVE(s)Description
2021CVE-2021-23369Template injection sandbox escape
2022CVE-2022-36067Sandbox escape via prototype pollution
2023CVE-2023-29017RCE via vm.runInNewContext
2023CVE-2023-37903Nesting + require combination escape
2026CVE-2026-47131/37/40/08Four simultaneous escapes, patched in 3.11.4

This pattern reflects the fundamental difficulty of implementing a JavaScript-level sandbox. Each patch narrows one escape vector; creative attackers find another.


Related CVEs in This Batch

All four patched in vm2 3.11.4 (2026-06-12):

CVEMechanism
CVE-2026-47131Buffer prototype hijack via __lookupGetter__ + TypeError
CVE-2026-47137Strict equality bypass on require: false check
CVE-2026-47140process and inspector/promises missing from builtin denylist
CVE-2026-47208 (this advisory)General sandbox breakout — arbitrary host command execution

Key Takeaways

  1. CVE-2026-47208 is the fourth in a batch of CVSS 10.0 vm2 sandbox escapes — all patched in vm2 3.11.4
  2. JavaScript-level sandboxing is architecturally fragile; these recurring CVEs demonstrate that pure-JS isolation cannot provide strong security guarantees
  3. Any application using vm2 < 3.11.4 to execute untrusted code should be considered fully compromised in risk modeling
  4. Upgrade to vm2 3.11.4 immediately, and evaluate whether the workload requires stronger OS-level isolation
  5. Run npm audit to catch downstream packages that may bundle a vulnerable vm2 version

Sources

  • CVE-2026-47208 — NIST NVD
  • vm2 on npm
  • vm2 GitHub Releases
  • CWE-284: Improper Access Control
  • OWASP Code Injection
#CVE-2026-47208#vm2#Node.js#Sandbox Escape#RCE#Arbitrary Code Execution#CVSS 10.0#Critical#NVD

Related Articles

CVE-2026-47131: vm2 Sandbox Escape via Buffer Prototype Hijack (CVSS 10.0)

A CVSS 10.0 critical sandbox escape in vm2 for Node.js allows sandboxed code to obtain the host TypeError constructor via Buffer.__lookupGetter__ abuse,...

6 min read

CVE-2026-47137: vm2 Sandbox Escape via Strict Equality require Bypass (CVSS 10.0)

A CVSS 10.0 critical sandbox escape in vm2 for Node.js allows attackers to bypass the require: false security option using falsy values, circumventing the...

6 min read

CVE-2026-47140: vm2 Sandbox Escape via Incomplete Builtin Denylist (CVSS 10.0)

A CVSS 10.0 critical sandbox escape in vm2 for Node.js allows sandboxed code to access the host process via the process and inspector/promises builtins,...

6 min read
Back to all Security Alerts