Security Vulnerability Report
中文
CVE-2026-34776 CVSS 5.3 MEDIUM

CVE-2026-34776

Published: 2026-04-04 00:16:19
Last Modified: 2026-04-27 13:09:55

Description

Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to versions 38.8.6, 39.8.1, 40.8.1, and 41.0.0, on macOS and Linux, apps that call app.requestSingleInstanceLock() were vulnerable to an out-of-bounds heap read when parsing a crafted second-instance message. Leaked memory could be delivered to the app's second-instance event handler. This issue is limited to processes running as the same user as the Electron app. Apps that do not call app.requestSingleInstanceLock() are not affected. Windows is not affected by this issue. This issue has been patched in versions 38.8.6, 39.8.1, 40.8.1, and 41.0.0.

CVSS Details

CVSS Score
5.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/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.1
Electron < 40.8.1
Electron < 41.0.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC Concept for CVE-2026-34776 // Triggering the out-of-bounds read in Electron on macOS/Linux // This script acts as the malicious second instance. const { app } = require('electron'); // Attempt to acquire the single instance lock const gotTheLock = app.requestSingleInstanceLock(); if (!gotTheLock) { // This block runs in the second instance // In a real exploit scenario, the underlying C++ parsing logic // is triggered by the OS-specific messaging mechanism when // the second instance starts. // We simulate the existence of the vulnerability trigger condition. console.log('Exploit: Triggering crafted second-instance message...'); // The actual payload is delivered via the OS IPC mechanism // which Electron parses. If the parsing logic is vulnerable, // the main instance experiences the out-of-bounds read. app.quit(); } else { // This block runs in the main instance app.on('second-instance', (event, commandLine, workingDirectory) => { // If exploited, leaked memory might be observable here or in logs console.log('Main instance received event from second instance.'); console.log('Command Line:', commandLine); console.log('Working Directory:', workingDirectory); }); app.whenReady().then(() => { console.log('Main instance started and holding lock.'); }); }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-34776", "sourceIdentifier": "[email protected]", "published": "2026-04-04T00:16:18.753", "lastModified": "2026-04-27T13:09:54.683", "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.1, 40.8.1, and 41.0.0, on macOS and Linux, apps that call app.requestSingleInstanceLock() were vulnerable to an out-of-bounds heap read when parsing a crafted second-instance message. Leaked memory could be delivered to the app's second-instance event handler. This issue is limited to processes running as the same user as the Electron app. Apps that do not call app.requestSingleInstanceLock() are not affected. Windows is not affected by this issue. This issue has been patched in versions 38.8.6, 39.8.1, 40.8.1, and 41.0.0."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:L", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 1.0, "impactScore": 4.2}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-125"}]}], "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.1", "matchCriteriaId": "8F28D187-306E-4C9D-ADED-56DD79B04AF3"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "40.0.0", "versionEndExcluding": "40.8.1", "matchCriteriaId": "A8E19E38-B08F-4075-A564-E14DC3F54078"}, {"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"}, {"vulnerable": true, "criteria": "cpe:2.3:a:electronjs:electron:41.0.0:beta8:*:*:*:node.js:*:*", "matchCriteriaId": "7F47CFAE-9744-4B54-B7E4-BB8E4346FDBA"}]}]}], "references": [{"url": "https://github.com/electron/electron/security/advisories ... (truncated)