CVE-2026-70603: Electron Shell.openPath Path Validation Bypass Vulnerability

MODERATE
Advisory Identifier: GHSA-5c9j-mhmv-5xgx
CVSS 6.0
CWE-158 CWE-20
Published
Advisory Summary

CVE-2026-70603 is a MODERATE (CVSS 6.0) shell.openpath path validation bypass vulnerability (CWE-158: Improper Neutralization of Null Byte or NUL Character) affecting Electron libraries in the npm ecosystem. The issue involves shell.openpath path validation bypass via embedded null byte. Remediation is available by upgrading affected packages to version 42.0.0-beta.1, 41.1.1, 40.9.0, 39.8.6.

CVE-2026-70603 at a Glance

CVE Identifier CVE-2026-70603
GHSA Identifier GHSA-5c9j-mhmv-5xgx
Severity MODERATE
CVSS v3.1 Base Score 6.0
CWE Classification CWE-158: Improper Neutralization of Null Byte or NUL Character
Affected Product Electron
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.0

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

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
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-70603

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: 42.0.0-beta.1
npm install electron@42.0.0-beta.1
electron fixed: 41.1.1
npm install electron@41.1.1
electron fixed: 40.9.0
npm install electron@40.9.0
electron fixed: 39.8.6
npm install electron@39.8.6
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-70603, 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 42.0.0-beta.1), 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-158: Improper Neutralization of Null Byte or NUL Character, where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes nul characters or null bytes when they are sent to a downstream component. 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 `shell.openPath()` did not reject paths containing embedded null bytes. Apps that perform string-only validation of file paths (for example, checking the file extension) before passing them to `shell.openPath()` could be bypassed, allowing an attacker-controlled path to open a different file than the one that passed validation. Apps are only affected if they pass paths derived from untrusted input to `shell.openPath()` and rely on string-based validation without a filesystem check. Node's `fs` APIs already reject paths containing null bytes, so apps that call `fs.existsSync()`, `fs.stat()`, or similar before `shell.openPath()` are not affected. Apps that do not call `shell.openPath()` with untrusted input are not affected. ### Workarounds Reject any path containing a null byte before passing it to `shell.openPath()`: ```js if (filePath.includes('\0')) throw new Error('invalid path'); ``` ### Fixed Versions * `42.0.0-beta.1` * `41.1.1` * `40.9.0` * `39.8.6` ### For more information If you have any questions or comments about this advisory, email us at [security@electronjs.org](mailto:security@electronjs.org)

CVE-2026-70603 Affected Electron Versions

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

References

Frequently Asked Questions

What is CVE-2026-70603?
CVE-2026-70603 is a security vulnerability in Electron involving shell.openPath path validation bypass via embedded null byte under CWE-158: Improper Neutralization of Null Byte or NUL Character.
Which Electron versions are affected?
Affected versions include releases prior to 42.0.0-beta.1, 41.1.1, 40.9.0, 39.8.6 across affected packages: electron.
What version fixes CVE-2026-70603?
Upgrading to 42.0.0-beta.1, 41.1.1, 40.9.0, 39.8.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is electron affected?
Yes, electron is affected in releases prior to 42.0.0-beta.1, 41.1.1, 40.9.0, 39.8.6. Upgrade your dependency to 42.0.0-beta.1, 41.1.1, 40.9.0, 39.8.6 or later.
What is the CVSS score of CVE-2026-70603?
CVE-2026-70603 has a CVSS v3.1 base score of 6.0 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-70603?
CVE-2026-70603 is classified under CWE-158: Improper Neutralization of Null Byte or NUL Character (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes NUL characters or null bytes when they are sent to a downstream component.).
How can I check npm dependencies for CVE-2026-70603?
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-5c9j-mhmv-5xgx",
  "modified" : "2026-08-05T15:57:03Z",
  "published" : "2026-08-05T15:57:03Z",
  "aliases" : [ "CVE-2026-70603" ],
  "summary" : "Electron: shell.openPath path validation bypass via embedded null byte",
  "details" : "### Impact\n`shell.openPath()` did not reject paths containing embedded null bytes. Apps that perform string-only validation of file paths (for example, checking the file extension) before passing them to `shell.openPath()` could be bypassed, allowing an attacker-controlled path to open a different file than the one that passed validation.\n\nApps are only affected if they pass paths derived from untrusted input to `shell.openPath()` and rely on string-based validation without a filesystem check. Node's `fs` APIs already reject paths containing null bytes, so apps that call `fs.existsSync()`, `fs.stat()`, or similar before `shell.openPath()` are not affected. Apps that do not call `shell.openPath()` with untrusted input are not affected.\n\n### Workarounds\nReject any path containing a null byte before passing it to `shell.openPath()`:\n```js\nif (filePath.includes('\\0')) throw new Error('invalid path');\n```\n\n### Fixed Versions\n* `42.0.0-beta.1`\n* `41.1.1`\n* `40.9.0`\n* `39.8.6`\n\n### For more information\nIf you have any questions or comments about this advisory, email us at [security@electronjs.org](mailto:security@electronjs.org)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "42.0.0-alpha.1"
      }, {
        "fixed" : "42.0.0-beta.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "41.0.0-alpha.1"
      }, {
        "fixed" : "41.1.1"
      } ]
    } ]
  }, {
    "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" : "0"
      }, {
        "fixed" : "39.8.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/security/advisories/GHSA-5c9j-mhmv-5xgx"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/electron/electron"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-158", "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-05T15:57:03Z",
    "nvd_published_at" : null
  }
}