Description
Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to 39.8.7, 40.9.0, 41.2.0, and 42.0.0-beta.1, the mode option of webContents.openDevTools() was not sanitized before use by the DevTools frontend. If an attacker can influence this value, script under their control may run in the DevTools context, which in unsandboxed configurations has access to Node.js, including when untrusted input reaches the mode argument of openDevTools() or untrusted content calls openDevTools() on a webview it embeds. This issue is fixed in 39.8.7, 40.9.0, 41.2.0, and 42.0.0-beta.1.
Published: 2026-08-05
Score: 5.7 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Unvalidated input to the mode option of webContents.openDevTools() allows an attacker to inject JavaScript that runs in the DevTools context. When the DevTools instance is running without sandboxing, this code gains full Node.js access, potentially allowing system‑level compromise. The vulnerability is a classic code‑injection flaw and is classified under CWE‑94 and CWE‑116. The impact is the execution of arbitrary code with the privileges of the Electron process.

Affected Systems

Electron framework versions prior to 39.8.7, 40.9.0, 41.2.0, and 42.0.0‑beta.1 are affected. Applications that embed a webview or otherwise call openDevTools() with unsanitized parameters or that operate in an unsandboxed environment are at risk. The issue is fixed in the listed releases.

Risk and Exploitability

The CVSS base score is 5.7, indicating moderate severity. No EPSS score is available and the vulnerability is not in the CISA KEV catalog. Exploitation requires the attacker to supply a crafted mode value or to control a component that invokes openDevTools(). In typical usage this might arise from untrusted content calling openDevTools() on a webview, making the attack vector likely local to the application context rather than from an external network source.

Generated by OpenCVE AI on August 5, 2026 at 19:45 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Electron to the minimum patched releases: 39.8.7, 40.9.0, 41.2.0, or 42.0.0‑beta.1.
  • Configure DevTools to run in sandboxed mode or disable Node.js integration when it is not required.
  • Validate or sanitize any value passed to the mode option of openDevTools(); ensure that untrusted input cannot influence it.

Generated by OpenCVE AI on August 5, 2026 at 19:45 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-4f78-qhmw-8j8m Electron: DevTools JavaScript Injection via Unsanitized Dock State Parameter
History

Wed, 05 Aug 2026 20:45:00 +0000

Type Values Removed Values Added
First Time appeared Electron
Electron electron
Vendors & Products Electron
Electron electron

Wed, 05 Aug 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Wed, 05 Aug 2026 18:00:00 +0000

Type Values Removed Values Added
Description Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to 39.8.7, 40.9.0, 41.2.0, and 42.0.0-beta.1, the mode option of webContents.openDevTools() was not sanitized before use by the DevTools frontend. If an attacker can influence this value, script under their control may run in the DevTools context, which in unsandboxed configurations has access to Node.js, including when untrusted input reaches the mode argument of openDevTools() or untrusted content calls openDevTools() on a webview it embeds. This issue is fixed in 39.8.7, 40.9.0, 41.2.0, and 42.0.0-beta.1.
Title Electron: DevTools JavaScript Injection via Unsanitized Dock State Parameter
Weaknesses CWE-116
CWE-94
References
Metrics cvssV3_1

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


Subscriptions

Electron Electron
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-06T03:55:49.348Z

Reserved: 2026-08-04T19:50:27.329Z

Link: CVE-2026-70609

cve-icon Vulnrichment

Updated: 2026-08-05T19:35:10.846Z

cve-icon NVD

Status : Received

Published: 2026-08-05T18:17:15.307

Modified: 2026-08-06T05:17:09.140

Link: CVE-2026-70609

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-05T20:30:06Z

Weaknesses
  • CWE-116

    Improper Encoding or Escaping of Output

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')