{"id":"CVE-2026-70603","aliases":["EUVD-2026-53436","GHSA-5c9j-mhmv-5xgx"],"status":"published","title":"Electron: shell.openPath path validation bypass via embedded null byte","description":"Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1, 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. This issue is fixed in versions 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1.","severity":{"version":"3.1","score":6,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00132,"percentile":0.02858,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-158","CWE-20"],"published":"2026-08-05T15:56:50Z","modified":"2026-11-03T22:13:31Z","fixes":[{"ecosystem":"npm","package":"electron","fixed_in":["42.0.0-beta.1","41.1.1","40.9.0","39.8.6"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"electron","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"42.0.0-alpha.1"},{"fixed":"42.0.0-beta.1"}]}]},{"source":"ghsa","ecosystem":"npm","package":"electron","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"41.0.0-alpha.1"},{"fixed":"41.1.1"}]}]},{"source":"ghsa","ecosystem":"npm","package":"electron","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"40.0.0-alpha.1"},{"fixed":"40.9.0"}]}]},{"source":"ghsa","ecosystem":"npm","package":"electron","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"39.8.6"}]}]},{"source":"osv","ecosystem":"npm","package":"electron","ranges":[{"type":"SEMVER","events":[{"introduced":"42.0.0-alpha.1"},{"fixed":"42.0.0-beta.1"}]}]},{"source":"osv","ecosystem":"npm","package":"electron","ranges":[{"type":"SEMVER","events":[{"introduced":"41.0.0-alpha.1"},{"fixed":"41.1.1"}]}]},{"source":"osv","ecosystem":"npm","package":"electron","ranges":[{"type":"SEMVER","events":[{"introduced":"40.0.0-alpha.1"},{"fixed":"40.9.0"}]}]},{"source":"osv","ecosystem":"npm","package":"electron","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"39.8.6"}]}]}],"products":[{"vendor":"electron","product":"electron"},{"vendor":"electronjs","product":"electron"}],"references":[{"url":"https://github.com/electron/electron/security/advisories/GHSA-5c9j-mhmv-5xgx","tags":["x_refsource_CONFIRM","Vendor Advisory","advisory","web"]},{"url":"https://github.com/advisories/GHSA-5c9j-mhmv-5xgx"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/70xxx/CVE-2026-70603.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-70603","tags":["advisory"]},{"url":"https://github.com/electron/electron","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-70603","title":"Electron: shell.openPath path validation bypass via embedded null byte","description":"Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1, 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. This issue is fixed in versions 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1.","status":"published","published":"2026-08-05T15:56:50.574Z","modified":"2026-11-03T22:13:31.217Z","cvss":[{"version":"3.1","score":6,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-20","CWE-158"],"updated_at":"2026-11-03T23:33:09.822755Z"}],"euvd":[{"id":"EUVD-2026-53436","description":"Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1, 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. This issue is fixed in versions 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1.","status":"published","published":"2026-08-05T15:56:50Z","modified":"2026-11-03T22:13:31Z","cvss":[{"version":"3.1","score":6,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","level":"medium"}],"updated_at":"2026-11-03T23:01:34.013136Z"}],"ghsa":[{"id":"GHSA-5c9j-mhmv-5xgx","title":"Electron: shell.openPath path validation bypass via embedded null byte","description":"### 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)","status":"published","published":"2026-08-05T15:57:03Z","modified":"2026-08-05T15:57:06Z","cvss":[{"version":"3.1","score":6,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","level":"medium"}],"cwes":["CWE-20","CWE-158"],"updated_at":"2026-11-02T14:40:56.852119Z"}],"nvd":[{"id":"CVE-2026-70603","description":"Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1, 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. This issue is fixed in versions 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1.","status":"published","published":"2026-08-05T16:17:04.47Z","modified":"2026-11-03T23:17:53.147Z","cvss":[{"version":"3.1","score":6,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","level":"medium","assessor":"secondary"}],"cwes":["CWE-20","CWE-158"],"updated_at":"2026-11-04T01:48:34.004968Z"}],"osv":[{"id":"CVE-2026-70603","title":"Electron: shell.openPath path validation bypass via embedded null byte","description":"Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1, 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. This issue is fixed in versions 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1.","status":"published","published":"2026-08-05T15:56:50.574Z","modified":"2026-11-05T02:30:51.674726369Z","cvss":[{"version":"3.1","score":6,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","level":"medium"}],"cwes":["CWE-158","CWE-20"],"updated_at":"2026-11-07T03:08:09.473992Z"},{"id":"GHSA-5c9j-mhmv-5xgx","title":"Electron: shell.openPath path validation bypass via embedded null byte","description":"### 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)","status":"published","published":"2026-08-05T15:57:03Z","modified":"2026-08-05T16:11:06.665641Z","cvss":[{"version":"3.1","score":6,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","level":"medium"}],"cwes":["CWE-158","CWE-20"],"updated_at":"2026-11-02T15:46:38.213481Z"}]}}
