CVE-2026-70609

Electron: DevTools JavaScript Injection via Unsanitized Dock State Parameter

Published Aug 5, 2026 CVSS 3.1 · 5.7 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

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
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:42.0.0:alpha1:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:42.0.0:alpha2:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:42.0.0:alpha3:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:42.0.0:alpha4:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:42.0.0:alpha5:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:42.0.0:alpha6:*:*:*:node.js:*:*
cpe:2.3:a:electronjs:electron:42.0.0:beta1:*:*:*:node.js:*:*
Vendors & Products Electronjs
Electronjs electron
Type Values Removed Values Added
First Time appeared Electron
Electron electron
Vendors & Products Electron
Electron electron
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 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'}

Weaknesses
  • CWE-116

    Improper Encoding or Escaping of Output

  • CWE-94

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

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Aug 6, 2026, 3:55 AM
Reserved
Aug 4, 2026, 7:50 PM
Status
Analyzed
Published
Aug 5, 2026, 6:17 PM
Modified
Oct 8, 2026, 1:53 PM