Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply untrusted path containing embedded null byte
-
DeliveryPass string-only extension validation check
-
Exploitshell.openPath() receives unsanitized path
-
ExecutionOS runtime truncates at null byte boundary
-
PersistUnintended file resolved and opened
-
ImpactArbitrary file execution or sensitive file exposure
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
|
| Exploitation Conditions | Three conditions must all be true simultaneously: (1) the Electron application must accept file path input derived from an untrusted or attacker-influenced source - this includes renderer-to-main IPC, protocol handlers, CLI arguments, or any externally supplied string used as a path; (2) the application must validate the path using JavaScript string operations only (e.g., path.endsWith('.pdf'), /\.txt$/.test(path)) without making any Node.js fs API call (fs.existsSync, fs.stat, fs.access, fs.realpath) on that path before passing it to shell.openPath() - apps that call any fs method are not affected because Node already rejects null-byte paths at that layer; and (3) the attacker must be able to inject a null byte into the path string reaching the application. Additionally, CVSS UI:R indicates user interaction is required to trigger the file-open action, limiting automated or fully silent exploitation. The combination of AC:H and these three specific preconditions means the vast majority of Electron applications - those that either do not use shell.openPath() with untrusted input, or that perform any fs-level check - are not affected. |
| Impact | The CVSS 3.1 score of 6.0 accurately reflects a constrained attack surface: AV:L confines exploitation to the local context of a running Electron application, AC:H requires a specific and relatively uncommon application code pattern (untrusted input + string-only validation + shell.openPath()), PR:L requires the attacker to have some level of access to supply crafted input, and UI:R means a user action (e.g., opening a file) must trigger the vulnerable path. The C:H/I:H impact metrics are realistic - arbitrary file execution or exposure is the outcome - but the conditions required to reach that impact are narrow. No EPSS score is present in the source data, preventing quantitative exploitation probability assessment; this absence should be noted by security teams. No CISA KEV listing and no public POC code are confirmed, indicating this is not actively exploited at scale. Real-world risk is primarily relevant to Electron apps in environments where attackers can influence file path inputs - for example, apps that handle user-supplied URLs, IPC messages from web content, or file paths from external data sources - and where developers have relied solely on string-based path validation rather than filesystem-level checks. |
| Exploit ScenarioDerived | An attacker who can supply a crafted file path to a vulnerable Electron application - for instance, via an IPC message from a renderer process, a URI handler, a CLI argument, or an application-level file picker that accepts external input - provides a path such as '/safe/uploads/report.pdf\0/tmp/malware.exe'. The application's string-based validation checks the extension, finds '.pdf', and passes the path to shell.openPath(); the OS runtime interprets the string up to the null byte, resolving to '/tmp/malware.exe' and launching the attacker's payload in the user's desktop context. No public exploit code is known at time of analysis, but null-byte injection as a technique is well-documented and the exploitation concept is straightforward for developers familiar with the pattern. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 05, 2026
Path validation bypass in Electron's shell.openPath() allows an attacker-controlled file to be opened in place of one that passed string-based extension validation, due to embedded null bytes not being rejected before OS-level path resolution. Electron-based desktop applications that accept untrusted file paths, validate them using only JavaScript string methods (e.g., endsWith(), regex extension checks), and then pass them to shell.openPath() are affected; apps using Node.js fs APIs (fs.existsSync(), fs.stat()) prior to the call are explicitly not vulnerable. Fixed in versions 39.8.6, 40.9.0, 41.1.1, and 42.0.0-beta.1; no public exploit identified at time of analysis.
RemediationAI
Upgrade Electron to a patched release: 39.8.6 (stable 39.x line), 40.9.0 (stable 40.x line), 41.1.1 (stable 41.x line), or 42.0.0-beta.1 (beta line), as documented at https://github.com/electron/electron/security/advisories/GHSA-5c9j-mhmv-5xgx. For applications that cannot immediately upgrade, the vendor-recommended workaround is to explicitly reject any path containing a null byte before passing it to shell.openPath(): enforce if (filePath.includes('\0')) throw new Error('invalid path'); at every call site. A structurally stronger mitigation - independent of the Electron version - is to perform a filesystem-level existence check using Node's fs.existsSync() or fs.stat() before calling shell.openPath(), as Node fs APIs already reject null-byte paths; this approach has the additional benefit of confirming the file exists and is accessible. Applications that do not pass untrusted input to shell.openPath() require no remediation action.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 4 packages in npm, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Electron (npm package, cpe:2.3:a:electron:electron:*) is a cross-platform desktop application framework combining Chromium and Node.js. Its shell.openPath() function delegates a file path string to the underlying OS shell for opening, but prior to the fix, it passed the string without null-byte sanitization. This creates a classic null-byte injection condition (CWE-20, Improper Input Validation): at the JavaScript layer, a path like '/valid/document.pdf\0/malicious.exe' appears to end in '.pdf', but POSIX/C runtime string functions treat '\0' as a string terminator, so the OS may resolve only '/valid/document.pdf' or exhibit platform-dependent truncation behavior. Node.js fs APIs already guard against this - they throw on null-byte paths - so apps that call any fs method on the path before shell.openPath() are protected by that existing guard. The vulnerability exists precisely in the gap between JavaScript-layer string validation and native OS path resolution.
Know when Electron gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N
Local vector because exploitation requires influencing a running desktop app's input; AC:H reflects mandatory triple precondition (untrusted input + string-only validation + shell.openPath call); PR:L for attacker's ability to supply input; UI:R because user triggers the file-open action; no availability impact.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
GitHub Electron versions 1.8.2-beta.3 and earlier, 1.7.10 and earlier, 1.6.15 and earlier has a vulnerability in the pro
Remote code execution in 5ire 0.15.2 and earlier arises because the desktop AI assistant renders Mermaid diagrams with s
Cross-site scripting in DeepChat's Mermaid diagram renderer escalates to full remote code execution on affected desktop
Remote code execution in DeepChat 0.5.1 and below is possible through a cross-site scripting flaw in Mermaid diagram ren
Stored cross-site scripting in SiYuan through 3.8.4 lets an attacker who can set a notebook name containing an HTML payl
GitHub Electron before 1.6.8 allows remote command execution because of a nodeIntegration bypass vulnerability. Rated hi
GitHub Electron 1.7.15, 1.8.7, 2.0.7, and 3.0.0-beta.6, in certain scenarios involving IFRAME elements and "nativeWindow
Electron version 1.7 up to 1.7.12; 1.8 up to 1.8.3 and 2.0.0 up to 2.0.0-beta.3 contains an improper handling of values
electron-updater allows for automatic updates for Electron apps. Rated high severity (CVSS 7.5), this vulnerability is r
Cross-origin read bypass in Electron's custom protocol handler exposes sensitive application data to remote pages via fe
Native code execution outside the Chromium sandbox is achievable in Electron prior to 39.8.9, 40.9.2, 41.2.1, and 42.0.0
In Electron before versions 7.2.4, 8.2.4, and 9.0.0-beta21, there is a context isolation bypass. Rated critical severity
EUVD-2026-53436
GHSA-5c9j-mhmv-5xgx
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB