JLSEC-2026-1802: Use After Free
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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
electronto a version that resolves this vulnerability.Fixed in 39.8.1 - Upgrade
Upgrade
electronto a version that resolves this vulnerability.Fixed in 40.7.0 - Upgrade
Upgrade
electronto a version that resolves this vulnerability.Fixed in 41.0.0
Event History
Frequently Asked Questions
Which applications are affected by this issue?
Only apps that enable offscreen rendering with webPreferences.offscreen: true and permit child windows through setWindowOpenHandler are affected. Apps that do not use offscreen rendering or deny child windows are not affected.
What condition is required to trigger the vulnerability?
A parent offscreen WebContents must be destroyed while a child window opened through window.open() remains open. Later paint frames on that child window can then dereference freed memory, potentially causing a crash or memory corruption.
Which patched Electron versions address the issue?
The issue is patched in Electron versions 39.8.1, 40.7.0, and 41.0.0.
What can be done if an update cannot be applied immediately?
Disable offscreen rendering or configure setWindowOpenHandler to deny child windows. Either condition prevents the affected code path from being used.