Skip to main content
Vulnerability Database/CVE-2026-102674

CVE-2026-102674: Electron Framework XSS Vulnerability

CVE-2026-102674 is a cross-site scripting vulnerability in Electron Framework affecting sandboxed documents that can bypass origin restrictions through popup windows. This article covers technical details, affected versions, security impact, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-102674 Overview

Electron is a framework for building cross-platform desktop applications using JavaScript, HTML, and CSS. CVE-2026-102674 is a sandbox bypass affecting Electron versions prior to 41.10.6, 42.9.2, 43.4.1, and 44.0.0-beta.5. Windows opened from a sandboxed top-level document did not inherit the parent document's active HTML sandbox restrictions. Untrusted content permitted to open popups could therefore create a new window running with the Electron application's full origin instead of the restricted sandbox origin. The flaw is classified as [CWE-266] Incorrect Privilege Assignment.

Critical Impact

Sandboxed untrusted web content can escape its sandbox by opening a popup that executes with the host application's full origin privileges.

Affected Products

  • Electron versions prior to 41.10.6
  • Electron versions prior to 42.9.2 (42.x branch)
  • Electron versions prior to 43.4.1 (43.x branch) and 44.0.0-beta.5 (44.x beta)

Discovery Timeline

  • 2026-09-29 - CVE-2026-102674 published to NVD
  • 2026-09-29 - Last updated in NVD database

Technical Details for CVE-2026-102674

Vulnerability Analysis

The vulnerability affects Electron's window creation logic in shell/browser/api/electron_api_web_contents.cc. When a sandboxed top-level document called window.open(), Electron consulted the sandbox flags of the initiating render frame only when that frame had a parent. Top-level frames were skipped, so their active HTML sandbox policy container flags were not propagated to the newly created WebContents. The resulting popup window was created with the Electron application's default origin and privileges, effectively bypassing the sandbox attribute the developer relied upon.

Root Cause

The root cause is a missing branch in the sandbox flag inheritance path. Electron's code guarded sandbox propagation behind initiator->GetParent(), restricting inheritance to child frames. This assumption ignored the case where a sandboxed top-level frame opens a window, causing content::WebContentsImpl::CreateWithOpener to construct the new contents without the parent's sandbox restrictions.

Attack Vector

Exploitation requires an Electron application that loads untrusted content in a sandboxed top-level document and permits window.open() calls. The attacker-controlled document opens a popup, which is then rendered with the application's full origin rather than the intended sandbox origin. Applications that block popups using setWindowOpenHandler returning { action: 'deny' } are not affected. User interaction is required to trigger the popup, and the scope change reflects the crossing of the sandbox trust boundary.

text
     auto* initiator = static_cast<content::RenderFrameHostImpl*>(
         content::RenderFrameHost::FromID(params.source_render_process_id,
                                          params.source_render_frame_id));
-    if (initiator && initiator->GetParent()) {
+    if (initiator) {
       // Use the initiating document's active sandboxing flag set (its policy
       // container flags), which is what
       // content::WebContentsImpl::CreateWithOpener consults when deciding

Source: Electron Commit 29fc1305. The patch removes the GetParent() check so top-level sandboxed frames also propagate their sandbox flags to opened windows.

Detection Methods for CVE-2026-102674

Indicators of Compromise

  • Popup or child BrowserWindow instances created from a sandboxed document that render with the Electron app's file:// or app:// origin instead of the expected restricted origin.
  • Unexpected invocations of Node.js or Electron APIs originating from windows that were opened from untrusted third-party content.
  • Renderer processes launched without the --enable-sandbox command-line flag when opened from a sandboxed initiator.

Detection Strategies

  • Inventory installed Electron applications and compare bundled Electron runtime versions against the fixed releases 41.10.6, 42.9.2, 43.4.1, and 44.0.0-beta.5.
  • Review application source for setWindowOpenHandler usage; applications that deny popups are not affected, so absence of a deny-by-default handler indicates exposure.
  • Instrument the web-contents-created event to log the origin and sandbox flags of every new WebContents for baseline comparison.

Monitoring Recommendations

  • Monitor endpoints for anomalous child process creation from Electron binaries following user interaction with untrusted web content.
  • Log and alert on outbound network connections initiated by Electron renderer processes to unexpected domains.
  • Track application updates through software distribution channels to confirm timely deployment of patched Electron builds.

How to Mitigate CVE-2026-102674

Immediate Actions Required

  • Upgrade Electron to 41.10.6, 42.9.2, 43.4.1, or 44.0.0-beta.5 or later and rebuild affected desktop applications.
  • Register a setWindowOpenHandler on every BrowserWindow that returns { action: 'deny' } for popups originating from untrusted content.
  • Audit all <iframe sandbox> and top-level sandboxed navigation paths to confirm no untrusted content can invoke window.open() unchecked.

Patch Information

The fix is tracked in GitHub Security Advisory GHSA-gr2m-v5gq-v685 and shipped in Electron Release v41.10.6, Electron Release v42.9.2, Electron Release v43.4.1, and Electron Beta Release v44.0.0-beta.5. The code change removes the initiator->GetParent() guard so sandbox flags propagate from top-level frames to opened windows.

Workarounds

  • Deny all popups from sandboxed or untrusted content by returning { action: 'deny' } from setWindowOpenHandler until the runtime is upgraded.
  • Load untrusted content only inside a <webview> or child frame whose parent is not a sandboxed top-level document, so existing inheritance logic applies.
  • Disable Node.js integration and enable contextIsolation and sandbox: true on all BrowserWindow instances handling third-party content.
bash
# Deny popups from untrusted content in the main process
const { app, BrowserWindow } = require('electron')

app.whenReady().then(() => {
  const win = new BrowserWindow({
    webPreferences: { sandbox: true, contextIsolation: true, nodeIntegration: false }
  })

  win.webContents.setWindowOpenHandler(({ url }) => {
    return { action: 'deny' }
  })
})

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.