HIGH 8.7

CVE-2026-47135: vm2 Sandbox Escape via Cross-Realm Symbol Injection

vm2 is a popular Node.js sandbox designed to safely execute untrusted code. A flaw in how it protects against dangerous JavaScript symbols allows attackers to bypass the sandbox and execute code with the privileges of the parent Node.js process. An attacker can craft malicious code that obtains cross-realm symbols (special JavaScript objects that exist in the host context), inject them into host objects, and hijack critical host-side functionality—such as the util.promisify method—to gain control over the host environment. The vulnerability affects all versions before 3.11.4.

Source data · NVD / CISA · public domain

CVSS
3.1 · 8.7 HIGH · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N
Weaknesses (CWE)
CWE-693
Affected products
0 configuration(s)
Published / Modified
2026-06-12 / 2026-06-17

NVD description (verbatim)

vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.4, Symbol.for override in setup-sandbox.js only intercepts 2 of 9 dangerous Node.js cross-realm symbols. Combined with the bridge's set/defineProperty/deleteProperty traps having no isDangerousCrossRealmSymbol key check, sandbox code can obtain real cross-realm symbols, write them to host objects, and control host-side behavior — verified with a full util.promisify hijack chain. This issue has been patched in version 3.11.4.

3 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability stems from incomplete Symbol protection in setup-sandbox.js. The sandbox intercepts Symbol.for() to prevent access to dangerous cross-realm symbols, but only covers 2 of 9 critical symbols. More critically, the bridge's set, defineProperty, and deleteProperty traps lack isDangerousCrossRealmSymbol checks, creating a path for sandbox code to write unfiltered cross-realm symbols to host objects. By leveraging this mechanism, an attacker can chain symbol injection to compromise host APIs—the disclosed proof-of-concept demonstrates hijacking util.promisify to gain execution control. This is a symbol-based sandbox escape, not a memory corruption issue.

Business impact

Organizations relying on vm2 to safely execute user-supplied JavaScript (e.g., plugin systems, configuration scripts, serverless execution platforms) face significant risk. An attacker can escape the sandbox and execute arbitrary code in the host Node.js process, leading to data theft, host compromise, lateral movement to other services, and potential supply-chain exposure if vm2 is embedded in widely distributed tools. The attack requires no special privileges and can be triggered remotely if the application exposes sandbox execution as a service.

Affected systems

vm2 versions prior to 3.11.4 are affected. The vulnerability has no vendor/product designation in public advisories at this time, but any application or library that directly imports and uses vm2 for sandboxing is at risk. This includes Node.js applications that use vm2 for plugin isolation, dynamic code execution, or multi-tenant script execution.

Exploitability

Exploitation requires the attacker to provide code that runs inside the vm2 sandbox—a capability that must exist in the application design. The attack complexity is high (AC:H) because it involves understanding symbol mechanics and the bridge's property traps, but once weaponized, no additional privileges or user interaction are needed. Remote triggering is possible if the application accepts external code submissions. Public proof-of-concept code showing the util.promisify chain has been documented, raising the likelihood of derivative exploits.

Remediation

Upgrade vm2 to version 3.11.4 or later immediately. This patch extends Symbol.for interception to cover all 9 dangerous cross-realm symbols and adds isDangerousCrossRealmSymbol checks to the bridge's property traps. After patching, test your application's sandbox behavior to ensure compatibility. For users unable to patch immediately, consider restricting sandbox access to trusted code only or disabling vm2 in favor of other isolation mechanisms (e.g., Worker threads with message passing, child processes, or external services).

Patch guidance

Patch version 3.11.4 is available and recommended. Update your package.json or lockfile to reference vm2@^3.11.4 or higher, then run npm update or equivalent. Verify the patch by checking the package metadata and running a quick integration test on sandboxed code execution. If your application pins vm2 to a specific version, update the pinned version constraint. Monitor vm2 releases for any follow-up security updates, as symbol-based escapes may require iterative hardening.

Detection guidance

Monitor application logs for unexpected calls to util.promisify or other core Node.js utilities from within sandbox contexts—these may indicate exploitation attempts. Intrusion detection systems (IDS) can look for unusual property access patterns on host objects or unexpected Symbol creation within sandboxed environments. Code review of user-supplied scripts should flag any attempts to access Symbol global, Symbol.for, or reflect-based operations. If your application logs sandbox errors, watch for TypeError or property-related exceptions that might indicate failed escape attempts.

Why prioritize this

This vulnerability merits immediate patching (within 48–72 hours for critical systems). The CVSS score of 8.7 (HIGH) reflects high integrity and confidentiality impact with network-accessible attack surface. The practical demonstration of a full hijack chain (util.promisify) and the ease of exploitation once sandbox access is granted make it a real and present danger. Organizations using vm2 for multi-tenant execution, untrusted plugin loading, or external API-driven code execution should prioritize this above routine updates.

Risk score, explained

CVSS 3.1 score of 8.7 is driven by: (1) CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C—network-accessible attack vector, high complexity (symbol chaining), no privileges required, and scope change (sandbox → host), combined with (2) High confidentiality and integrity impact (C:H/I:H), meaning the attacker can read and modify host state. The absence of availability impact (A:N) reflects that the escape does not directly crash the host. AC:H reflects the need for attacker ingenuity in crafting the exploit, but this does not reduce urgency given published proof-of-concept.

Frequently asked questions

Does this affect vm2 in production Node.js environments immediately?

Yes. If your application accepts user-supplied code or plugin scripts and sandboxes them with vm2, an attacker can craft malicious input to escape the sandbox and execute code in the host process. The attack does not require any special deployment configuration—just that sandbox execution is enabled.

What is a 'cross-realm symbol' and why is it dangerous?

Symbols in JavaScript are unique identifiers that can exist in different execution realms (sandbox vs. host). Cross-realm symbols are symbols defined in the host realm that the sandbox is not supposed to access. By obtaining and writing them to host objects, an attacker can trick host code into executing attacker-controlled logic—similar to prototype pollution, but using symbols instead of property names.

Is there a workaround if we cannot upgrade immediately?

Upgrade should be your primary goal, but interim measures include: restricting sandbox input to trusted, pre-approved scripts only; disabling dynamic code execution features in your application until patching is complete; or migrating to alternative isolation methods such as Node.js Worker threads (with message passing) or separate child processes. Understand your risk tolerance before relying on workarounds.

How do we verify that version 3.11.4 fixes the issue?

After upgrading, confirm the package version with npm list vm2. Review the vm2 release notes or GitHub repository to confirm patch details. Run your existing test suite to ensure sandbox behavior remains unchanged. For additional assurance, test that symbol injection attacks fail (this would require security testing expertise or third-party validation).

This analysis is provided for informational purposes and based on the CVE record and public advisory data available as of the publish date. No exploit code or weaponized proof-of-concept instructions are included. Organizations should verify patch availability and compatibility with their specific deployment before implementing remediation. SEC.co does not warrant the accuracy of third-party vulnerability data; always consult the official vm2 repository and Node Security Database for authoritative updates. Source: NVD (public-domain), retrieved 2026-07-20. Analysis generated by SEC.co (claude-haiku-4-5).