{"id":"CVE-2026-70603","aliases":["CVE-2026-70603","GHSA-5c9j-mhmv-5xgx"],"related":[],"kind":"vulnerability","state":"published","title":"Electron: shell.openPath path validation bypass via embedded null byte","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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)","format":"markdown","source":"ghsa"}],"published":"2026-08-05T15:56:50.574Z","modified":"2026-11-03T23:17:53.147Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","score":6,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","score":6,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","score":6,"rating":"MEDIUM"}],"cwes":["CWE-20","CWE-158"],"affected":[{"ranges":[{"version":"< 39.8.6","status":"affected"},{"version":">= 40.0.0-alpha.1, < 40.9.0","status":"affected"},{"version":">= 41.0.0-alpha.1, < 41.1.1","status":"affected"},{"version":">= 42.0.0-alpha.1, < 42.0.0-beta.1","status":"affected"}],"vendor":"electron","product":"electron","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"42.0.0-alpha.1","status":"affected","fixed":"42.0.0-beta.1"}],"ecosystem":"npm","package":"electron","purl":"pkg:npm/electron","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"41.0.0-alpha.1","status":"affected","fixed":"41.1.1"}],"ecosystem":"npm","package":"electron","purl":"pkg:npm/electron","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"40.0.0-alpha.1","status":"affected","fixed":"40.9.0"}],"ecosystem":"npm","package":"electron","purl":"pkg:npm/electron","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"39.8.6"}],"ecosystem":"npm","package":"electron","purl":"pkg:npm/electron","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"39.8.6"},{"status":"affected","introduced":"40.0.0","fixed":"40.9.0"},{"status":"affected","introduced":"41.0.0","fixed":"41.1.1"},{"status":"affected","version":"42.0.0"},{"status":"affected","version":"42.0.0"},{"status":"affected","version":"42.0.0"},{"status":"affected","version":"42.0.0"},{"status":"affected","version":"42.0.0"},{"status":"affected","version":"42.0.0"},{"status":"affected","version":"42.0.0"}],"vendor":"electronjs","product":"electron","cpe":"cpe:2.3:a:electronjs:electron:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/electron/electron/security/advisories/GHSA-5c9j-mhmv-5xgx","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/electron/electron","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-08-06T03:55:28.551Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-70603","url":"https://www.cve.org/CVERecord?id=CVE-2026-70603","licence":"CVE Terms of Use","modified":"2026-11-03T22:13:31.217Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5c9j-mhmv-5xgx","url":"https://github.com/advisories/GHSA-5c9j-mhmv-5xgx","licence":"CC-BY-4.0","modified":"2026-08-05T16:11:06.665Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-70603","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-70603","licence":"Public domain","modified":"2026-11-03T23:17:53.147Z"}],"updatedAt":"2026-11-25T22:59:31.127Z","epss":{"score":0.00128,"percentile":0.02633,"date":"2026-12-01T12:00:22.000Z"}}