Microsoft
CVE-2026-34773
HIGH
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
|
| Impact | The CVSS score of 4.7 with a vector of AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N reflects a local attack vector requiring low privileges and high complexity to exploit, with high integrity impact but no confidentiality or availability impact. The integrity-focused impact aligns with registry hijacking-the attacker can modify registry entries but cannot directly read sensitive data or crash the system. The requirement for local access (AV:L) and low-level user privileges (PR:L) significantly constrains real-world exploitation, as attackers must first gain local system access. The high complexity (AC:H) suggests the attack requires specific conditions or non-obvious exploitation steps. However, the vulnerability is context-dependent: only applications that pass untrusted input (e.g., from command-line arguments, external files, or network sources) to setAsDefaultProtocolClient() are at risk; hardcoded protocol names are safe. The straightforward nature of the validation bypass and the potential for protocol hijacking (a notable privilege escalation or lateral movement technique) elevate practical concern for vulnerable applications, even though the CVSS base score is moderate. |
| Exploit ScenarioDerived | An Electron-based application accepts a protocol name from a user-supplied configuration file or command-line argument and passes it directly to app.setAsDefaultProtocolClient(protocol). An attacker crafts a malicious protocol string such as 'test\..\protocolhandler' or uses registry path traversal syntax to cause the registry write to target a sibling subkey under HKCU\Software\Classes\ that belongs to a legitimate protocol handler (e.g., 'http' or 'mailto'). Upon the vulnerable application's next execution, the attacker's registry entry overwrites the legitimate handler, causing the hijacked protocol to launch the attacker's chosen executable instead of the original handler. No public exploit code has been identified at time of analysis, but the vulnerability is straightforward to exploit once untrusted input is identified in an application. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 03, 2026
Electron's setAsDefaultProtocolClient() on Windows fails to validate protocol names before writing to the Windows registry, allowing local authenticated attackers to hijack protocol handlers by writing to arbitrary HKCU\Software\Classes\ subkeys when apps pass untrusted input as the protocol parameter. The vulnerability affects Electron versions prior to 38.8.6, 39.8.1, 40.8.1, and 41.0.0, and requires local access and low privileges; no public exploit has been identified at time of analysis.
RemediationAI
Vendor-released patches are available: Electron 38.8.6, 39.8.1, 40.8.1, and 41.0.0 contain the fix. Applications must update to the appropriate patched version for their major version branch. As an interim workaround, applications should validate protocol names against the regular expression /^[a-zA-Z][a-zA-Z0-9+.-]*$/ before passing them to app.setAsDefaultProtocolClient(); this ensures protocol names conform to RFC 3986 scheme syntax and prevents registry injection. Developers should also audit all callers of setAsDefaultProtocolClient() to identify whether untrusted input is being passed and apply the validation workaround immediately if such cases exist. For further guidance, contact security@electronjs.org or review https://github.com/electron/electron/security/advisories/GHSA-mwmh-mq4g-g6gr.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Electron is a framework for building cross-platform desktop applications using web technologies. On Windows, the setAsDefaultProtocolClient() API allows applications to register themselves as the default handler for custom protocol schemes (e.g., 'myapp://'). The vulnerability stems from insufficient input validation (CWE-20: Improper Input Validation) on the protocol name parameter before it is used to construct registry keys. Without validation, an attacker-controlled protocol name containing special characters or path traversal sequences can manipulate the registry write operation to target unintended subkeys under HKEY_CURRENT_USER\Software\Classes\, potentially overwriting legitimate protocol handler registrations. The affected CPE pkg:npm/electron indicates this affects the npm package across multiple major versions.
Know when the next one hits your stack
- 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:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
4DescriptionNVD
Impact
On Windows, app.setAsDefaultProtocolClient(protocol) did not validate the protocol name before writing to the registry. Apps that pass untrusted input as the protocol name may allow an attacker to write to arbitrary subkeys under HKCU\Software\Classes\, potentially hijacking existing protocol handlers.
Apps are only affected if they call app.setAsDefaultProtocolClient() with a protocol name derived from external or untrusted input. Apps that use a hardcoded protocol name are not affected.
Workarounds
Validate the protocol name matches /^[a-zA-Z][a-zA-Z0-9+.-]*$/ before passing it to app.setAsDefaultProtocolClient().
Fixed Versions
41.0.040.8.139.8.138.8.6
For more information
If there are any questions or comments about this advisory, please email [security@electronjs.org](mailto:security@electronjs.org)
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
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
GHSA-mwmh-mq4g-g6gr
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB