Skip to content

Electron: DevTools JavaScript Injection via Unsanitized Dock State Parameter

Moderate severity GitHub Reviewed Published Jul 27, 2026 in electron/electron

Package

npm electron (npm)

Affected versions

< 39.8.7
>= 40.0.0-alpha.1, < 40.9.0
>= 41.0.0-alpha.1, < 41.2.0
>= 42.0.0-alpha.1, < 42.0.0-beta.1

Patched versions

39.8.7
40.9.0
41.2.0
42.0.0-beta.1

Description

Impact

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.

Apps are only affected if untrusted input can reach the mode argument of openDevTools(), or if untrusted content can call openDevTools() on a <webview> it embeds. Apps that only ever pass a fixed dock mode are not affected.

Workarounds

Only pass fixed, allowlisted values (right, bottom, undocked, detach) as the DevTools mode, and do not expose openDevTools to untrusted content.

Fixed Versions

  • 42.0.0-beta.1
  • 41.2.0
  • 40.9.0
  • 39.8.7

For more information

If you have any questions or comments about this advisory, email Electron at security@electronjs.org

References

@MarshallOfSound MarshallOfSound published to electron/electron Jul 27, 2026
Published to the GitHub Advisory Database Aug 5, 2026
Reviewed Aug 5, 2026

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
High
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(25th percentile)

Weaknesses

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

The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. Learn more on MITRE.

Improper Encoding or Escaping of Output

The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved. Learn more on MITRE.

CVE ID

CVE-2026-70609

GHSA ID

GHSA-4f78-qhmw-8j8m

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.