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-47137: vm2 Sandbox Escape via Strict Equality require Bypass (CVSS 10.0)
CVE-2026-47137: vm2 Sandbox Escape via Strict Equality require Bypass (CVSS 10.0)

Critical Security Alert

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

SECURITYCRITICALCVE-2026-47137

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...

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-47137: vm2 Sandbox Escape via Strict Equality require Bypass

A maximum-severity sandbox escape tracked as CVE-2026-47137 has been identified in vm2, the popular Node.js sandbox library. With a CVSS v3.1 score of 10.0 (Critical), this flaw allows attackers to circumvent the require: false security restriction and escape the vm2 sandbox to execute arbitrary code on the host Node.js process.

The root cause is a strict equality check bug introduced in the fix for a prior CVE (GHSA-8hg8-63c5-gwmx / CVE-2023-37903). The mitigation used options.require === false (strict equality) instead of a truthy/falsy check, meaning any other falsy value for require — such as 0, "", null, or undefined — passes the guard and enables the restricted code path.

This vulnerability is patched in vm2 3.11.4.


Vulnerability Overview

AttributeValue
CVE IDCVE-2026-47137
CVSS Score10.0 (Critical)
Affected Softwarevm2 Node.js sandbox — all versions < 3.11.4
CWECWE-284 / Improper Access Control via logic bypass
Attack VectorLocal (sandboxed code execution)
Authentication RequiredNone — sandboxed context only
Primary ImpactFull sandbox escape and host code execution
SourceNVD / NIST (published 2026-06-12)
FixUpgrade to vm2 3.11.4

Background: The Prior Fix and Its Flaw

The Original CVE-2023-37903 Fix

The prior fix for CVE-2023-37903 (GHSA-8hg8-63c5-gwmx) added a check in nodevm.js at line 263 to block a dangerous combination:

nesting: true + require: false

The intent was: if nesting is enabled AND require is explicitly disabled, the combination is blocked because it represented a known sandbox escape path.

The check was written as:

// nodevm.js line 263 — the flawed check
if (options.nesting === true && options.require === false) {
  throw new Error("...");  // Block the dangerous combination
}

Why === false Is Insufficient

The === false strict equality check only matches the literal boolean false. JavaScript has many falsy values that evaluate to false in conditionals but do not equal false under strict equality:

Value=== falseFalsy (behaves as false)
false✓✓
0✗✓
""✗✓
null✗✓
undefined✗✓

This means an attacker can supply require: 0 or require: null to satisfy vm2's interpretation of "require is disabled" while still passing through the guard:

// Attacker bypasses the security check:
const {NodeVM} = require('vm2');
const vm = new NodeVM({
  nesting: true,
  require: 0  // Falsy but not === false → bypasses the guard
});
vm.run(`
  // Now inside a vm2 with nesting: true and effectively no require restriction
  // Can use nesting to reach host realm...
`);

Technical Exploitation Path

The bypass works because:

  1. options.require === false evaluates to false when require is 0, null, "", etc.
  2. The block is not executed — the "dangerous combination" guard is skipped
  3. The nesting: true path continues, which was the vector for the original CVE-2023-37903 escape
  4. The attacker re-uses the original nesting-based escape technique that the patch was intended to block

In effect, the fix for CVE-2023-37903 contained a logic error that makes it trivially bypassable with a one-character change to the payload.


Impact Assessment

Impact AreaDescription
Host RCEAttacker escapes vm2 sandbox and runs arbitrary code on host
Prior Patch NullifiedThe CVE-2023-37903 fix is effectively defeated
Low ComplexityBypass requires only changing require: false to require: 0 in existing exploits
Multi-tenant ExposureAny platform using vm2 for tenant isolation is fully exposed
Supply Chain RiskLibraries bundling vm2 internally inherit the bypass

Detection

Look for vm2 initialization with non-boolean falsy values for require:

# Audit your codebase for potentially bypassed vm2 options
grep -r "require:" . --include="*.js" --include="*.ts" | grep -E "require:\s*(0|null|undefined|\"\")"

Also audit transitive dependencies:

npm ls vm2
# or
yarn why vm2

Remediation

Upgrade vm2 to 3.11.4

npm update vm2
# or
yarn upgrade vm2

The fix in 3.11.4 changes the check to properly handle all falsy values:

// Fixed check (conceptual):
if (options.nesting === true && !options.require) {
  throw new Error("...");  // Catches all falsy require values
}

Consider Structural Mitigations

If you cannot immediately upgrade, consider:

  1. Validate require option type before passing to vm2:

    const requireOpt = typeof options.require === 'boolean' ? options.require : false;
    const vm = new NodeVM({ require: requireOpt });
  2. Disable nesting entirely if not needed — the dangerous combination requires nesting: true.

  3. Migrate to OS-level isolation for untrusted code execution (Worker Threads, containers, Deno).


Related CVEs in This Batch

This is one of four vm2 sandbox escapes all fixed in version 3.11.4:

CVEVulnerability
CVE-2026-47131Buffer prototype hijack via __lookupGetter__ + TypeError
CVE-2026-47137 (this advisory)Strict equality bypass enables require: false circumvention
CVE-2026-47140Incomplete denylist — process and inspector/promises not blocked
CVE-2026-47208General sandbox breakout enabling arbitrary host command execution

Key Takeaways

  1. CVE-2026-47137 is a CVSS 10.0 logic bypass — changing require: false to require: 0 defeats vm2's own CVE-2023-37903 patch
  2. Strict equality (===) checks against false are dangerous when you intend "falsy" — always use !value or explicitly check the type
  3. All vm2 versions prior to 3.11.4 are vulnerable, regardless of prior CVE remediation
  4. The low exploit complexity (one character change) means weaponized PoCs for the original CVE likely already bypass this
  5. Upgrade to vm2 3.11.4 or migrate to stronger sandboxing primitives

Sources

  • CVE-2026-47137 — NIST NVD
  • vm2 on npm
  • GHSA-8hg8-63c5-gwmx — Prior CVE-2023-37903 Advisory
  • CWE-697: Incorrect Comparison
#CVE-2026-47137#vm2#Node.js#Sandbox Escape#RCE#Strict Equality#Logic Bypass#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-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

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.

6 min read
Back to all Security Alerts