CVE-2026-70609
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-70609 is a JavaScript injection vulnerability in the Electron framework, formally titled "DevTools JavaScript Injection via Unsanitized Dock State Parameter." The mode option passed to webContents.openDevTools() was not sanitized before being used by the DevTools frontend, allowing attacker-controlled script to execute in the DevTools context. Affected versions include all Electron releases prior to 39.8.7, 40.x before 40.9.0, 41.x before 41.2.0, and 42.x alpha builds before 42.0.0-beta.1. The vulnerability was reported by researcher hackerman70000, published on August 5, 2026, and carries a CVSS v3.1 base score of 5.7 (Medium) (GitHub Advisory).

Technical details

The root cause is that the internal dock_state_ member — derived from the mode argument of webContents.openDevTools() — was concatenated directly into a JavaScript string and executed via ExecuteJavaScript() in the DevTools context without any validation or escaping (CWE-94: Code Injection; CWE-116: Improper Encoding or Escaping of Output). An attacker who can influence the mode argument, or whose untrusted content can call openDevTools() on an embedded webview, can inject arbitrary JavaScript that runs in the DevTools context. In unsandboxed Electron configurations, the DevTools context has access to Node.js APIs, significantly elevating the impact. The fix validates dock_state_ against an allowlist of four known values (right, bottom, undocked, detach) and falls back to "right" for any unrecognized input (GitHub Advisory, Fix PR #50665).

Impact

Successful exploitation allows attacker-controlled JavaScript to execute within the Electron DevTools context. In unsandboxed application configurations, this grants access to Node.js, enabling high-impact confidentiality and integrity compromise — including file system access, credential theft, and arbitrary command execution on the host system. Availability is not directly impacted. Applications that only pass fixed, hardcoded dock mode values are not affected; the risk is scoped to apps that expose openDevTools() to untrusted input or allow untrusted content to call it on embedded webviews (GitHub Advisory).

Exploitation steps

  1. Identify a vulnerable target: Find an Electron application (version < 39.8.7, 40.x < 40.9.0, 41.x < 41.2.0, or 42.x alpha < 42.0.0-beta.1) that passes user-controlled or externally influenced input to the mode argument of webContents.openDevTools(), or that allows untrusted embedded webview content to call openDevTools().
  2. Craft a malicious mode value: Prepare a string that, when concatenated into the JavaScript template used by the DevTools frontend, injects additional JavaScript code (e.g., right'; <injected_js>; var x=').
  3. Deliver the payload: Supply the crafted value through the application's attack surface — for example, via a malicious web page loaded in an embedded webview that calls openDevTools() with attacker-controlled parameters, or by influencing application logic that passes external data to openDevTools().
  4. Achieve code execution in DevTools context: The unsanitized dock_state_ value is concatenated into a JS string and executed via ExecuteJavaScript() in the DevTools context, running the injected script.
  5. Leverage Node.js access: In unsandboxed configurations, use the DevTools context's Node.js access to read files, exfiltrate credentials, spawn child processes, or perform further lateral movement on the host system (GitHub Advisory, Fix PR #50665).

Indicators of compromise

  • Logs: Unexpected or malformed mode parameter values (not one of right, bottom, undocked, detach) passed to openDevTools() in application logs or crash reports.
  • Process: Unusual child processes spawned by the Electron application process (e.g., shell commands, curl, wget, scripting interpreters) that are inconsistent with normal application behavior.
  • Network: Unexpected outbound network connections from the Electron application process to unknown external hosts, potentially indicating data exfiltration.
  • File System: Unexpected file reads or writes in sensitive directories (e.g., credential stores, SSH keys, application data) by the Electron process.

Mitigation and workarounds

Electron has released patched versions: 39.8.7, 40.9.0, 41.2.0, and 42.0.0-beta.1. Developers should upgrade to one of these versions immediately. As a workaround for applications that cannot upgrade immediately, only pass fixed, allowlisted values (right, bottom, undocked, detach) as the mode argument to openDevTools(), and never expose openDevTools() to untrusted content or user-controlled input. Applications that already use only hardcoded dock mode values are not affected by this vulnerability (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-71319CRITICAL9.6
  • JavaScript logoJavaScript
  • @nuxt/devtools
NoYesAug 05, 2026
CVE-2026-70611MEDIUM6.9
  • JavaScript logoJavaScript
  • electron
NoYesAug 05, 2026
CVE-2026-70609MEDIUM5.7
  • JavaScript logoJavaScript
  • electron
NoYesAug 05, 2026
CVE-2026-70612MEDIUM5.4
  • JavaScript logoJavaScript
  • electron
NoYesAug 05, 2026
CVE-2026-70610MEDIUM5.4
  • JavaScript logoJavaScript
  • electron
NoYesAug 05, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management