CVE-2026-47698
Executive Summary
CVE-2026-47698 describes a critical sandbox escape vulnerability in the vm2 library for Node.js, affecting all versions prior to 3.11.6. This flaw allows malicious code executing within the vm2 sandbox to break out and achieve arbitrary command execution on the host system. The vulnerability carries a CVSSv3.1 score of 9.8 (Critical), indicating remote exploitability without requiring authentication or user interaction, leading to complete compromise of confidentiality, integrity, and availability.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Technical Analysis
The vulnerability in vm2 stems from an insufficient blocking mechanism within the lib/bridge.js and lib/setup-sandbox.js files. Specifically, the sandbox environment fails to properly restrict "stacked indirection through Function.prototype.call around dangerous host prototype getter and setter mutators." This critical oversight allows code running within the vm2 sandbox to manipulate the prototype chain of host intrinsic objects.
In JavaScript, objects inherit properties and methods from their prototype. By exploiting the described stacked indirection, an attacker can effectively "sever a host intrinsic's prototype chain," breaking the intended isolation. This manipulation grants the malicious sandbox code the ability to reach e.constructor.constructor, a well-known primitive for escaping JavaScript sandboxes. Accessing e.constructor.constructor (where e is an object, and constructor refers to its constructor function) typically leads to the Function constructor, which in turn can be used to execute arbitrary JavaScript code outside the sandbox's control, ultimately enabling arbitrary command execution on the underlying Node.js host system.
The core mechanism revolves around the sandbox failing to adequately sanitize or block specific reflective operations, particularly those involving Function.prototype.call when used in a nested or indirect manner to bypass security checks on prototype access. This type of vulnerability falls under CWE-913: Improper Control of Dynamically-Managed Code Resources, as the sandbox fails to maintain strict isolation boundaries for dynamically executed code.
Exploitation Scenarios
Exploitation of CVE-2026-47698 would follow a typical pattern for sandbox escape vulnerabilities within a Node.js environment:
Reconnaissance/Target Identification: An attacker identifies a Node.js application that utilizes the
vm2sandbox library, running a version prior to 3.11.6. This identification might occur through internal network scanning, source code analysis (in supply chain attacks), or by observing application behavior that suggests the use of a sandboxed environment (e.g., executing untrusted user-provided JavaScript code). Direct external fingerprinting ofvm2is challenging, as it's a library, not a network service.Flaw Triggering: The attacker crafts a malicious JavaScript payload intended for execution within the
vm2sandbox. This payload specifically leverages the "stacked indirection through Function.prototype.call" mechanism described in the NVD. The attacker's code would employ carefully constructed calls that exploit the flaw inlib/bridge.jsandlib/setup-sandbox.jsto bypass the sandbox's protections against prototype manipulation.Payload/Execution Method: The malicious sandbox code would then utilize the ability to "sever a host intrinsic's prototype chain." This manipulation allows the attacker to gain access to a context outside the sandbox, specifically by reaching
e.constructor.constructor. Once this primitive is obtained, the attacker can use it to instantiate theFunctionconstructor in the host context. This effectively enables arbitrary JavaScript code execution directly within the main Node.js process that hosts thevm2sandbox. The executed JavaScript code can then interact with the Node.jschild_processmodule or other host system capabilities to execute arbitrary shell commands.Post-Exploitation Impact: Upon successful exploitation, the attacker achieves complete arbitrary command execution on the underlying operating system. Given the CVSS vector's Confidentiality, Integrity, and Availability subscores are all "High" (C:H, I:H, A:H), this translates to severe consequences. The attacker could:
- Exfiltrate sensitive data from the host system.
- Modify or corrupt system files and application data.
- Install backdoors, malware, or other persistent access mechanisms.
- Achieve full system takeover, including potential for lateral movement to other systems on the network.
- Disrupt the availability of the compromised Node.js application and potentially the entire host system.
No public Proof-of-Concept (PoC) is currently available; therefore, the attack chain is inferred from the vulnerability class and the specific technical details provided in the NVD description.
Impact Assessment
CVE-2026-47698 presents a critically severe risk, as evidenced by its CVSSv3.1 score of 9.8. The core impact stems from the ability to achieve full arbitrary command execution on the host system from within an intended sandbox environment.
- Attack Vector (AV:N - Network): The vulnerability is remotely exploitable, meaning an attacker does not need local access to the system. If the Node.js application exposes a pathway for untrusted code execution (e.g., a service processing user-provided JavaScript), it can be exploited over a network.
- Attack Complexity (AC:L - Low): The exploit likely does not require complex conditions or specialized knowledge beyond understanding JavaScript sandbox internals. Once the technical details of the prototype chain manipulation are understood, creating an exploit would be relatively straightforward.
- Privileges Required (PR:N - None): Exploitation does not require any prior authentication or privileges within the context of the vulnerable application. The attacker only needs to be able to submit code for execution within the
vm2sandbox. - User Interaction (UI:N - None): No human interaction is needed for a successful exploit. Once the malicious code is submitted to the sandbox, the escape occurs automatically.
- Scope (S:U - Unchanged): The vulnerability does not change the security scope. The attacker moves from the sandbox to the host environment, but the host environment itself remains the target scope.
- Confidentiality (C:H - High): An attacker can read any data accessible by the compromised Node.js process, potentially including sensitive configuration files, user data, application secrets, and any data on the host system.
- Integrity (I:H - High): An attacker can modify or delete any data accessible by the Node.js process, leading to data corruption, defacement, or arbitrary code injection into legitimate application components.
- Availability (A:H - High): An attacker can completely disrupt the availability of the Node.js application and potentially the entire host system by terminating processes, corrupting critical system files, or installing resource-exhausting malware.
From a business perspective, the impact is catastrophic. A successful exploit could lead to:
- Data Breaches: Unauthorized access to sensitive customer data, intellectual property, or internal credentials.
- Service Disruption: Application downtime, denial of service, and critical business function impairment.
- System Takeover: Complete compromise of the server hosting the Node.js application, potentially leading to lateral movement across the internal network.
- Reputational Damage: Loss of customer trust, regulatory fines, and legal repercussions stemming from data breaches or service outages.
Organizations utilizing vm2 in environments where untrusted code is executed face an immediate and severe risk.
Detection Guidance
Detecting exploitation of CVE-2026-47698 is challenging without specific exploit payload signatures, as the vulnerability resides within a library's internal logic. Detection should focus on anomalous behavior originating from the Node.js process hosting the vm2 sandbox, particularly unexpected process creation, file system modifications, or network connections.
Sigma Rule
title: Node.js vm2 Sandbox Escape - Unexpected Child Process Creation
id: 6a2c270d-c0d1-4a30-80d4-1a3b5930e4ef
status: experimental
description: Detects suspicious child process creation by a Node.js process, indicative of a vm2 sandbox escape.
author: valtersit.com
date: 2024/01/01
logsource:
category: process_creation
product: windows
service: security
detection:
selection_node:
ParentImage|endswith:
- '\node.exe'
- '\nodejs.exe'
selection_suspicious_child:
Image|endswith:
- '\cmd.exe'
- '\powershell.exe'
- '\sh.exe'
- '\bash.exe'
- '\pwsh.exe'
- '\perl.exe'
- '\python.exe'
- '\ruby.exe'
- '\wget.exe'
- '\curl.exe'
CommandLine|contains:
- 'whoami'
- 'id'
- 'cat /etc/passwd'
- 'ls -la /'
- 'dir C:\'
- 'systeminfo'
- 'ipconfig'
- 'netstat -an'
- 'nc -lvnp'
- 'bitsadmin /transfer'
condition: selection_node and selection_suspicious_child
falsepositives:
- Legitimate Node.js applications that intentionally execute shell commands via child processes (e.g., build tools, system utilities).
level: high
YARA Rule
rule CVE_2026_47698_vm2_SandboxEscape_PostExploit {
meta:
author = "valtersit.com"
date = "2024-01-01"
description = "Detects potential post-exploitation artifacts related to vm2 sandbox escape in Node.js processes or memory."
cve = "CVE-2026-47698"
severity = "High"
strings:
$s1 = "Function.prototype.call" nocase ascii wide
$s2 = "e.constructor.constructor" nocase ascii wide
$s3 = "require('child_process')" nocase ascii wide
$s4 = "execSync(" nocase ascii wide
$s5 = "spawnSync(" nocase ascii wide
$s6 = "eval(" nocase ascii wide
$s7 = "process.mainModule.require" nocase ascii wide // Common sandbox escape primitive
condition:
// This rule targets memory dumps or compiled JavaScript files, looking for combinations of
// the exploit primitive mentions and common post-exploitation Node.js features.
// Due to the lack of specific exploit code, it's heuristics-based.
(1 of ($s1, $s2)) and (3 of ($s3, $s4, $s5, $s6, $s7))
}
Suricata IDS Rule
# Alert on suspicious outbound connections initiated from a Node.js process
# This rule is highly generic and prone to FPs; it requires tuning and baselining.
alert tcp any any -> any any (msg:"ET POLICY Possible Node.js Sandbox Escape Outbound Connection to High-Risk Port"; flow:established,to_server; app-layer.protocol:http; pcre:"/Host:\s*([a-zA-Z0-9.-]+\.onion|c2\.example\.com)/H"; classtype:trojan-activity; sid:20264769801;)
alert tcp any any -> any !($HOME_NET) (msg:"ET POLICY Node.js Process Initiating Outbound Shell Connection (High-Risk Port)"; flow:established,to_server; dport:21,22,23,25,53,80,443,445,3389; content:"User-Agent|3A| "; pcre:"/Node\.js/"; byte_test:1,>,0,0,little; threshold: type limit, track by_src, count 5, seconds 60; classtype:attempted-recon; sid:20264769802;)
# Note: Network-level detection for vm2 sandbox escape is extremely challenging
# unless the post-exploitation activities involve distinct network patterns.
# The above rules are illustrative and would need specific C2 indicators or highly
# abnormal traffic patterns to be effective.
Elastic Detection
{
"query": {
"bool": {
"filter": [
{
"term": {
"event.category": "process"
}
},
{
"term": {
"event.type": "start"
}
},
{
"wildcard": {
"process.parent.executable.keyword": "*node*"
}
},
{
"bool": {
"should": [
{
"wildcard": {
"process.executable.keyword": "*cmd.exe"
}
},
{
"wildcard": {
"process.executable.keyword": "*powershell.exe"
}
},
{
"wildcard": {
"process.executable.keyword": "*sh"
}
},
{
"wildcard": {
"process.executable.keyword": "*bash*"
}
},
{
"wildcard": {
"process.executable.keyword": "*python*"
}
},
{
"wildcard": {
"process.executable.keyword": "*perl*"
}
},
{
"wildcard": {
"process.executable.keyword": "*ruby*"
}
},
{
"wildcard": {
"process.executable.keyword": "*wget*"
}
},
{
"wildcard": {
"process.executable.keyword": "*curl*"
}
}
],
"minimum_should_match": 1
}
},
{
"bool": {
"should": [
{
"match_phrase": {
"process.command_line": "whoami"
}
},
{
"match_phrase": {
"process.command_line": "id"
}
},
{
"match_phrase": {
"process.command_line": "cat /etc/passwd"
}
},
{
"match_phrase": {
"process.command_line": "systeminfo"
}
},
{
"match_phrase": {
"process.command_line": "netstat -an"
}
},
{
"match_phrase": {
"process.command_line": "nc -lvnp"
}
}
],
"minimum_should_match": 1
}
}
]
}
}
}
Splunk SPL Query
index=YOUR_INDEX_NAME sourcetype=YOUR_PROCESS_LOGS
| where ParentProcessName IN ("node.exe", "nodejs.exe")
| where ProcessName IN ("cmd.exe", "powershell.exe", "sh", "bash", "pwsh", "python", "perl", "ruby", "wget", "curl")
| where CommandLine ILIKE "%whoami%" OR CommandLine ILIKE "%id%" OR CommandLine ILIKE "%cat /etc/passwd%" OR CommandLine ILIKE "%ls -la /%" OR CommandLine ILIKE "%dir C:%" OR CommandLine ILIKE "%systeminfo%" OR CommandLine ILIKE "%ipconfig%" OR CommandLine ILIKE "%netstat -an%" OR CommandLine ILIKE "%nc -lvnp%" OR CommandLine ILIKE "%bitsadmin /transfer%"
| `security_content_annotations`
| rename _time as Time, host as Host, ParentProcessName as Parent_Process, ProcessName as Child_Process, CommandLine as Child_Command_Line
| table Time, Host, Parent_Process, Child_Process, Child_Command_Line
| sort -Time
Wazuh OSSEC Rule
<group name="sysmon_eventchannel,process_creation,">
<rule id="100001" level="12">
<if_sid>60000</if_sid> <!-- Base rule for Sysmon process creation (Event ID 1) -->
<field name="ParentImage" type="pcre2">\bnode(\.exe)?\b</field>
<field name="Image" type="pcre2">\b(cmd\.exe|powershell\.exe|sh|bash|pwsh|perl|python|ruby|wget\.exe|curl\.exe)\b</field>
<description>Node.js vm2 Sandbox Escape - Suspicious Child Process Creation.</description>
<group>attack,command_execution,</group>
</rule>
<rule id="100002" level="14" overwrite="yes">
<if_sid>100001</if_sid>
<field name="CommandLine" type="pcre2" full_match="no">
(?i)(whoami|id|cat /etc/passwd|ls -la /|dir C:\\|systeminfo|ipconfig|netstat -an|nc -lvnp|bitsadmin /transfer)
</field>
<description>Node.js vm2 Sandbox Escape - Highly Suspicious Command Execution.</description>
<group>attack,command_execution,exploit,</group>
</rule>
</group>
Mitigation & Patch Guidance
Patch Confidence for CVE-2026-47698 is rated as 0/4 (UNPATCHED) as per the provided data, indicating no patch evidence from tracked sources. However, the NVD description explicitly states the issue is "fixed in version 3.11.6". This suggests that the vendor (vm2 project) has released a fix, but official patch tracking sources may not have yet updated.
Immediate Mitigations:
- Restrict Node.js Process Privileges: Run Node.js applications that utilize
vm2with the absolute minimum necessary operating system privileges. Limit file system access, network access, and the ability to spawn new processes. - Network Segmentation: Isolate Node.js applications using
vm2within a dedicated network segment with strict outbound firewall rules, allowing only necessary connections. This can limit the impact of a sandbox escape. - Input Validation & Sanitization: While this is a sandbox escape, not an input validation bypass, ensure that any code submitted to the
vm2sandbox is thoroughly validated and sanitized for common unsafe patterns before submission. This is a general best practice for code execution environments. - Runtime Application Self-Protection (RASP): Implement RASP solutions that can monitor the application's runtime behavior and detect/block anomalous process creation or system calls originating from the Node.js process.
- Restrict Node.js Process Privileges: Run Node.js applications that utilize
Patch/Upgrade Steps:
- Upgrade vm2 Library: The most effective mitigation is to upgrade the
vm2library to version3.11.6or later. This version contains the fix for CVE-2026-47698.- For
npmprojects:npm update vm2ornpm install vm2@latest(ensure it resolves to 3.11.6 or higher). - For
yarnprojects:yarn upgrade vm2oryarn add vm2@latest.
- For
- Dependency Scanning: Regularly scan your project's dependencies for known vulnerabilities using tools like
npm audit,yarn audit, Snyk, or Dependabot. - CI/CD Integration: Integrate vulnerability scanning into your Continuous Integration/Continuous Deployment (CI/CD) pipelines to catch vulnerable dependencies early in the development lifecycle.
- Upgrade vm2 Library: The most effective mitigation is to upgrade the
Long-Term Hardening:
- Review Sandbox Requirements: Re-evaluate the necessity of running untrusted code. If possible, avoid direct execution of arbitrary user-supplied JavaScript.
- Alternative Sandboxing Solutions: If sandboxing is critical, research and consider alternative, potentially more robust or actively maintained, sandboxing solutions for Node.js or utilize language-level constructs like Worker Threads with careful message passing if applicable.
- Application Security Architecture Review: Conduct regular security reviews of applications that handle untrusted input, especially those involving code execution, to identify and address architectural weaknesses.
- Least Privilege for Services: Ensure all services, including those running Node.js applications, operate with the absolute minimum necessary privileges on the host system.
References
- National Vulnerability Database (NVD) - CVE-2026-47698: https://nvd.nist.gov/vuln/detail/CVE-2026-47698 (Note: URL will become active upon publication)
- CWE-913: Improper Control of Dynamically-Managed Code Resources: https://cwe.mitre.org/data/definitions/913.html
- vm2 GitHub Repository (for fix context, if available): https://github.com/patriksimek/vm2 (Specific commit or release notes for 3.11.6 would be relevant, search within the repository for details once CVE is public)
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.