Electron: shell.openPath path validation bypass via embedded null byte (CVE-2026-70603)
Electron's shell.openPath() function did not properly reject file paths containing embedded null bytes. This allowed attackers to bypass string-only validation checks on file paths, potentially causing the application to open a different file than intended. The issue affects apps that pass untrusted input to shell.openPath() without performing filesystem-level validation. Versions prior to 39.8.6 are vulnerable. The vulnerability has been fixed in versions 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1.
AI Analysis
Technical Summary
The vulnerability in Electron's shell.openPath() arises because it does not reject file paths containing embedded null bytes. Applications that rely solely on string-based validation of file paths (e.g., checking file extensions) before calling shell.openPath() can be bypassed by an attacker supplying a path with an embedded null byte. This causes shell.openPath() to open a different file than the one that passed validation. Node.js filesystem APIs such as fs.existsSync() or fs.stat() already reject null bytes, so applications that perform such checks before calling shell.openPath() are not affected. The issue is fixed in Electron versions 39.8.6 and later.
Potential Impact
An attacker who can supply untrusted input to shell.openPath() in an affected Electron application can bypass string-only path validation checks. This may lead to opening unintended files, potentially exposing sensitive information or causing other unintended behavior. The vulnerability does not affect applications that perform filesystem-level validation or do not pass untrusted input to shell.openPath().
Mitigation Recommendations
A fix is available in Electron versions 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1. Applications should upgrade to one of these versions or later. As a workaround, applications can reject any file path containing a null byte before passing it to shell.openPath(), for example by checking if the path includes '\0' and throwing an error if it does. Applications that perform filesystem checks using Node.js fs APIs before calling shell.openPath() are not affected and do not require additional mitigation.
Electron: shell.openPath path validation bypass via embedded null byte (CVE-2026-70603)
Description
Electron's shell.openPath() function did not properly reject file paths containing embedded null bytes. This allowed attackers to bypass string-only validation checks on file paths, potentially causing the application to open a different file than intended. The issue affects apps that pass untrusted input to shell.openPath() without performing filesystem-level validation. Versions prior to 39.8.6 are vulnerable. The vulnerability has been fixed in versions 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1.
CVSS v3.1
Score 6.0medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Electron's shell.openPath() arises because it does not reject file paths containing embedded null bytes. Applications that rely solely on string-based validation of file paths (e.g., checking file extensions) before calling shell.openPath() can be bypassed by an attacker supplying a path with an embedded null byte. This causes shell.openPath() to open a different file than the one that passed validation. Node.js filesystem APIs such as fs.existsSync() or fs.stat() already reject null bytes, so applications that perform such checks before calling shell.openPath() are not affected. The issue is fixed in Electron versions 39.8.6 and later.
Potential Impact
An attacker who can supply untrusted input to shell.openPath() in an affected Electron application can bypass string-only path validation checks. This may lead to opening unintended files, potentially exposing sensitive information or causing other unintended behavior. The vulnerability does not affect applications that perform filesystem-level validation or do not pass untrusted input to shell.openPath().
Mitigation Recommendations
A fix is available in Electron versions 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1. Applications should upgrade to one of these versions or later. As a workaround, applications can reject any file path containing a null byte before passing it to shell.openPath(), for example by checking if the path includes '\0' and throwing an error if it does. Applications that perform filesystem checks using Node.js fs APIs before calling shell.openPath() are not affected and do not require additional mitigation.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-5c9j-mhmv-5xgx
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-70603"]
- Ecosystems
- ["npm"]
- Database Specific Severity
- MODERATE
- Cvss Version
- 3.1
Threat ID: 6a73851fbf8831d5394ef81a
Added to database: 08/05/2026, 18:46:55 UTC
Last enriched: 08/05/2026, 23:17:51 UTC
Last updated: 08/05/2026, 23:17:51 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.