Use After Free Affecting electron package, versions <39.8.1>=40.0.0-alpha.2 <40.7.0>=41.0.0-alpha.1 <41.0.0


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Use After Free vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-ELECTRON-15875869
  • published3 Apr 2026
  • disclosed3 Apr 2026
  • creditUnknown

Introduced: 3 Apr 2026

NewCVE-2026-34774  (opens in a new tab)
CWE-416  (opens in a new tab)

How to fix?

Upgrade electron to version 39.8.1, 40.7.0, 41.0.0 or higher.

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free in the offscreen rendering process when a parent WebContents is destroyed while a child window remains open. An attacker can cause memory corruption or application crash by triggering paint frames on the child window that dereference freed memory.

Note:

This is only exploitable if offscreen rendering is enabled (webPreferences.offscreen: true) and the setWindowOpenHandler permits child windows.

Workaround

This vulnerability can be mitigated by denying child window creation from offscreen renderers in your setWindowOpenHandler, or ensuring child windows are closed before the parent is destroyed.

CVSS Base Scores

version 4.0
version 3.1