Exposure of Resource to Wrong Sphere Affecting electron package, versions <39.8.5>=40.0.0-alpha.2 <40.8.5>=41.0.0-alpha.1 <41.1.0>=42.0.0-alpha.1 <42.0.0-alpha.5


Severity

Recommended
0.0
low
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 IDSNYK-JS-ELECTRON-15923931
  • published7 Apr 2026
  • disclosed7 Apr 2026
  • creditUnknown

Introduced: 7 Apr 2026

NewCVE-2026-34765  (opens in a new tab)
CWE-668  (opens in a new tab)

How to fix?

Upgrade electron to version 39.8.5, 40.8.5, 41.1.0, 42.0.0-alpha.5 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 Exposure of Resource to Wrong Sphere via the window.open() function. An attacker can gain access to or manipulate the browsing context of a window opened by a different renderer by using the same target name, potentially inheriting elevated permissions such as privileged preload scripts or relaxed security settings. This is only exploitable if multiple top-level windows with differing trust levels are opened and setWindowOpenHandler is used to grant elevated webPreferences to child windows.

Workaround

This vulnerability can be mitigated by denying window.open() in renderers that load untrusted content by returning { action: 'deny' } from setWindowOpenHandler and avoiding granting child windows more permissive webPreferences than their opener.

CVSS Base Scores

version 4.0
version 3.1