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.

2493+ Articles
160+ 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. vm2 Prototype Chain Escape via Function.prototype.call Stacking (CVE-2026-47698)
vm2 Prototype Chain Escape via Function.prototype.call Stacking (CVE-2026-47698)

Critical Security Alert

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

SECURITYCRITICALCVE-2026-47698

vm2 Prototype Chain Escape via Function.prototype.call Stacking (CVE-2026-47698)

Critical vm2 flaw lets sandboxed code sever host intrinsic prototype chains using stacked Function.prototype.call, escaping the sandbox entirely.

Dylan H.

Security Team

August 18, 2026
4 min read

Affected Products

  • vm2 < 3.11.6
  • Node.js applications using vm2 for sandboxing

Overview

A second critical sandbox escape vulnerability in vm2 (CVE-2026-47698) was disclosed alongside CVE-2026-47686 on August 17, 2026. This flaw resides in both lib/bridge.js and lib/setup-sandbox.js, where the library fails to block stacked indirection through Function.prototype.call around dangerous host prototype getter and setter mutators.

The result: sandboxed code can sever a host intrinsic's prototype chain and regain access to otherwise-blocked host objects — effectively escaping the sandbox. The vulnerability carries a CVSS score of 9.8 (Critical).


Vulnerability Details

FieldValue
CVE IDCVE-2026-47698
Componentslib/bridge.js, lib/setup-sandbox.js
Vulnerability TypeSandbox Escape / Prototype Chain Manipulation
CVSS Score9.8 (Critical)
Attack VectorNetwork
Privileges RequiredNone
User InteractionNone
Fixed Invm2 3.11.6

Technical Analysis

Root Cause

vm2 proxies host-side objects to prevent sandbox code from accessing dangerous properties. These proxies intercept getter and setter access on host prototypes. However, the interception logic in lib/bridge.js and lib/setup-sandbox.js does not account for stacked Function.prototype.call invocations.

In standard JavaScript, Function.prototype.call can be used to invoke a function with an explicit this context. By layering multiple calls through Function.prototype.call — pointing each invocation at a dangerous getter or setter on a host prototype — sandbox code can circumvent vm2's proxy intercept layer. This allows the sandboxed code to:

  1. Access host-realm prototype properties that vm2 intends to block
  2. Sever the prototype chain of a host intrinsic from inside the sandbox
  3. Regain a reference to the host's object graph, breaking containment

Attack Flow

  1. Sandbox code obtains a reference to Function.prototype.call (normally allowed, as it appears safe in isolation).
  2. The attacker builds a chain of nested .call() invocations targeting host prototype getters that vm2's proxy normally intercepts.
  3. The stacked indirection bypasses vm2's proxy interception logic in bridge.js.
  4. The attacker severs the prototype link between a host intrinsic and its shadow copy inside the sandbox.
  5. The attacker now holds a direct reference to the host-side object, with no proxy barrier.

Impact

  • Full sandbox escape — access to the host JavaScript runtime
  • Arbitrary code execution in the Node.js host process
  • Access to process, require, fs, and all host-side APIs
  • Privilege escalation if the Node.js process runs with elevated permissions

Relationship to CVE-2026-47686

Both CVE-2026-47686 and CVE-2026-47698 were patched in vm2 3.11.6 and represent distinct but related escape vectors:

CVE-2026-47686CVE-2026-47698
Root CauseError.cause not sanitized in handleException()Stacked Function.prototype.call bypasses proxy interception
Entry PointError propagation pathPrototype getter/setter access
Files Affectedlib/setup-sandbox.jslib/bridge.js, lib/setup-sandbox.js
CVSS9.99.8

Both should be treated as equally critical. Organizations using vm2 should assume both escape paths are available to any adversary until the patch is applied.


Affected Versions

All versions of vm2 prior to 3.11.6 are vulnerable.


Remediation

Immediate Fix

Update vm2 to 3.11.6 or later:

npm install vm2@latest
# or
yarn add vm2@latest

Verification

node -e "const {version} = require('vm2/package.json'); console.log(version);"
# Expected: 3.11.6 or higher

Defence-in-Depth

Given that vm2 has now disclosed two critical escapes in the same release cycle, consider:

  • Replacing vm2 with isolation mechanisms that operate at the OS or hypervisor level (e.g., Docker sandbox containers, AWS Lambda isolated functions, Deno's permission model, or Vercel Sandbox for ephemeral code execution).
  • Never running untrusted code in the same process as sensitive data or credentials, regardless of sandbox guarantees.

Detection

Runtime Monitoring

Watch for unusual Function.prototype.call chains originating from vm2-sandboxed execution contexts. This is difficult to detect at runtime without instrumentation; focus on patching.

Dependency Scanning

Ensure your dependency scanner flags vm2 versions below 3.11.6:

npm audit
# Look for: vm2 < 3.11.6

Recommendations

  • Update vm2 to 3.11.6+ immediately
  • Patch both CVE-2026-47686 and CVE-2026-47698 — same update resolves both
  • Evaluate replacing vm2 with OS-level sandboxing for higher-assurance environments
  • Run npm audit to confirm no other vm2-related advisories remain open
  • Consider Deno or isolated worker processes for untrusted code execution

Timeline

DateEvent
2026-08-17CVE-2026-47698 published to NVD
2026-08-17vm2 3.11.6 released with patch
2026-08-18Public advisory issued

Sources

  • NVD — CVE-2026-47698
  • vm2 GitHub Repository

Related Advisories

  • vm2 Error.cause Host Object Leak — CVE-2026-47686
#CVE#vm2#Node.js#Sandbox Escape#Prototype Pollution#RCE#NVD

Related Articles

vm2 Sandbox Escape via Error.cause Host Object Leak (CVE-2026-47686)

Critical vm2 sandbox escape allows Node.js sandbox code to access the host process object via unsanitized Error.cause, enabling full RCE.

4 min read

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
Back to all Security Alerts