CVE-2026-34774

Electron: Use-after-free in offscreen child window paint callback

Published Apr 3, 2026 CVSS 3.1 · 8.1 High EPSS < 1% KEV · Not listed
Description
Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to versions 39.8.1, 40.7.0, and 41.0.0, apps that use offscreen rendering and allow child windows via window.open() may be vulnerable to a use-after-free. If the parent offscreen WebContents is destroyed while a child window remains open, subsequent paint frames on the child dereference freed memory, which may lead to a crash or memory corruption. Apps are only affected if they use offscreen rendering (webPreferences.offscreen: true) and their setWindowOpenHandler permits child windows. Apps that do not use offscreen rendering, or that deny child windows, are not affected. This issue has been patched in versions 39.8.1, 40.7.0, and 41.0.0.

Analysis

AI-generated

Technical impact

The vulnerability is a use‑after‑free triggered during the paint callback of a child window rendered offscreen. When an offscreen WebContents parent is destroyed while a child window remains open, subsequent paint frames on that child dereference freed memory. The result can be a crash or memory corruption, potentially allowing exploitation to compromise application integrity or stability.

Affected Systems

The issue affects Electron releases prior to 39.8.1, 40.7.0, and 41.0.0. Applications that enable offscreen rendering (webPreferences.offscreen: true) and allow child windows via window.open() are at risk. All other Electron applications that do not use offscreen rendering or explicitly deny child windows are not affected.

Risk and Exploitability

The CVSS score of 8.1 classifies it as high severity, and the very low EPSS score (<1%) indicates a low probability of exploitation in the wild. It is not listed in CISA’s KEV catalog. Although the description only states a crash or memory corruption, the use‑after‑free could allow malicious code to run if an attacker crafts a suitable payload. The attack likely requires the application to be executed with the vulnerable settings, so threat vectors are limited to user‑controlled applications.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest patched version of Electron (39.8.1, 40.7.0, or 41.0.0) to all applications that use offscreen rendering.
  • If upgrade is not immediately feasible, disable offscreen rendering by setting webPreferences.offscreen to false for applications that do not require it.
  • Alternatively, ensure setWindowOpenHandler denies child windows for any application that must stay on older Electron releases.
  • Verify that no other processes hold references to offscreen WebContents before terminating them.

Generated by OpenCVE AI on April 7, 2026 at 01:46 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-532v-xpq5-8h95 Electron: Use-after-free in offscreen child window paint callback
History
Type Values Removed Values Added
First Time appeared Electronjs
Electronjs electron
CPEs cpe:2.3:a:electronjs:electron:*:*:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:alpha1:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:alpha2:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:alpha3:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:alpha4:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:alpha5:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:alpha6:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:beta1:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:beta2:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:beta3:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:beta4:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:beta5:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:beta6:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:beta7:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:41.0.0:beta8:*:*:*:node.js:*:*
Vendors & Products Electronjs
Electronjs electron
Type Values Removed Values Added
First Time appeared Electron
Electron electron
Weaknesses CWE-825
Vendors & Products Electron
Electron electron
References
Metrics threat_severity

None

threat_severity

Important

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to versions 39.8.1, 40.7.0, and 41.0.0, apps that use offscreen rendering and allow child windows via window.open() may be vulnerable to a use-after-free. If the parent offscreen WebContents is destroyed while a child window remains open, subsequent paint frames on the child dereference freed memory, which may lead to a crash or memory corruption. Apps are only affected if they use offscreen rendering (webPreferences.offscreen: true) and their setWindowOpenHandler permits child windows. Apps that do not use offscreen rendering, or that deny child windows, are not affected. This issue has been patched in versions 39.8.1, 40.7.0, and 41.0.0.
Title Electron: Use-after-free in offscreen child window paint callback
Weaknesses CWE-416
References
Metrics cvssV3_1

{'score': 8.1, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 15, 2026, 1:03 AM
Reserved
Mar 30, 2026, 7:54 PM
Status
Modified
Published
Apr 4, 2026, 12:16 AM
Modified
Jul 24, 2026, 10:10 PM
Severity
Important
Public date
Apr 3, 2026, 11:52 PM