CVE-2026-70603: Electron Shell.openPath Path Validation Bypass Vulnerability
MODERATECVE-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
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).
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.
npm install electron@42.0.0-beta.1
npm install electron@41.1.1
npm install electron@40.9.0
npm install electron@39.8.6
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
CVE-2026-70603 Affected Electron Versions
4 component(s)| 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?
Which Electron versions are affected?
What version fixes CVE-2026-70603?
Is electron affected?
What is the CVSS score of CVE-2026-70603?
What CWE is associated with CVE-2026-70603?
How can I check npm dependencies for CVE-2026-70603?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}