CVE-2026-70609: Electron DevTools JavaScript Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-4f78-qhmw-8j8m
CVSS 5.7
CWE-116 CWE-94
Published
Advisory Summary

CVE-2026-70609 is a MODERATE (CVSS 5.7) devtools javascript injection vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Electron libraries in the npm ecosystem. The issue involves devtools javascript injection via unsanitized dock state parameter. Remediation is available by upgrading affected packages to version 39.8.7, 40.9.0, 41.2.0, 42.0.0-beta.1.

CVE-2026-70609 at a Glance

CVE Identifier CVE-2026-70609
GHSA Identifier GHSA-4f78-qhmw-8j8m
Severity MODERATE
CVSS v3.1 Base Score 5.7
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product Electron
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-70609

To remediate this vulnerability, upgrade all affected Electron dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

electron fixed: 39.8.7
npm install electron@39.8.7
electron fixed: 40.9.0
npm install electron@40.9.0
electron fixed: 41.2.0
npm install electron@41.2.0
electron fixed: 42.0.0-beta.1
npm install electron@42.0.0-beta.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls electron

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-70609, inspect your project dependencies using npm:

npm ls electron

Analyze the terminal output to locate any version of Electron in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 39.8.7), your application is affected.

Note: The npm ls electron command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where 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. In Electron, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](mailto:security@electronjs.org)

CVE-2026-70609 Affected Electron Versions

4 component(s)
Fixed Versions:
39.8.740.9.041.2.042.0.0-beta.1
Product / Package Ecosystem Affected Versions Fixed Version
electron
npm
< 39.8.7
39.8.7
electron
npm
≥ 40.0.0-alpha.1
< 40.9.0
40.9.0
electron
npm
≥ 41.0.0-alpha.1
< 41.2.0
41.2.0
electron
npm
≥ 42.0.0-alpha.1
< 42.0.0-beta.1
42.0.0-beta.1

References

Frequently Asked Questions

What is CVE-2026-70609?
CVE-2026-70609 is a security vulnerability in Electron involving DevTools JavaScript Injection via Unsanitized Dock State Parameter under CWE-116: Improper Encoding or Escaping of Output.
Which Electron versions are affected?
Affected versions include releases prior to 39.8.7, 40.9.0, 41.2.0, 42.0.0-beta.1 across affected packages: electron.
What version fixes CVE-2026-70609?
Upgrading to 39.8.7, 40.9.0, 41.2.0, 42.0.0-beta.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is electron affected?
Yes, electron is affected in releases prior to 39.8.7, 40.9.0, 41.2.0, 42.0.0-beta.1. Upgrade your dependency to 39.8.7, 40.9.0, 41.2.0, 42.0.0-beta.1 or later.
What is the CVSS score of CVE-2026-70609?
CVE-2026-70609 has a CVSS v3.1 base score of 5.7 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-70609?
CVE-2026-70609 is classified under CWE-116: 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.).
How can I check npm dependencies for CVE-2026-70609?
Run the dependency tree command: 'npm ls electron'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4f78-qhmw-8j8m",
  "modified" : "2026-08-05T17:32:47Z",
  "published" : "2026-08-05T17:32:47Z",
  "aliases" : [ "CVE-2026-70609" ],
  "summary" : "Electron: DevTools JavaScript Injection via Unsanitized Dock State Parameter",
  "details" : "### Impact\nThe `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.\n\nApps 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.\n\n### Workarounds\nOnly pass fixed, allowlisted values (`right`, `bottom`, `undocked`, `detach`) as the DevTools `mode`, and do not expose `openDevTools` to untrusted content.\n\n### Fixed Versions\n* `42.0.0-beta.1`\n* `41.2.0`\n* `40.9.0`\n* `39.8.7`\n\n### For more information\nIf you have any questions or comments about this advisory, email Electron at [security@electronjs.org](mailto:security@electronjs.org)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "39.8.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "40.0.0-alpha.1"
      }, {
        "fixed" : "40.9.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "41.0.0-alpha.1"
      }, {
        "fixed" : "41.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "42.0.0-alpha.1"
      }, {
        "fixed" : "42.0.0-beta.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/security/advisories/GHSA-4f78-qhmw-8j8m"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/pull/50665"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/pull/50666"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/pull/50667"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/pull/50668"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/commit/04614eed17986bddc43eb509ec870424ee6a47d1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/commit/2046ae87731d80a7b535512ae19acb529e10e33b"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/commit/969741f9f847c5c583f6bbc63ca22549dbd954ce"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/commit/efc4d3c6b6f1c04f658ca0d9d2512dcfe78eb7ba"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/electron/electron"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/releases/tag/v39.8.7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/releases/tag/v40.9.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/releases/tag/v41.2.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/releases/tag/v42.0.0-beta.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-94" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-05T17:32:47Z",
    "nvd_published_at" : null
  }
}