4.7medium
Electron: Registry key path injection in app.setAsDefaultProtocolClient on Windows
- Severity
- 4.7medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.31% (higher than 17% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-mwmh-mq4g-g6gr
Description
Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to versions 38.8.6, 39.8.1, 40.8.1, and 41.0.0, 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. This issue has been patched in versions 38.8.6, 39.8.1, 40.8.1, and 41.0.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| electron electron | < 38.8.6, >= 39.0.0-alpha.1, < 39.8.1, >= 40.0.0-alpha.1, < 40.8.1, >= 41.0.0-alpha.1, < 41.0.0 | CVE List |
| electron (npm) | before 38.8.6, from 39.0.0-alpha.1 before 39.8.1, from 40.0.0-alpha.1 before 40.8.1, from 41.0.0-alpha.1 before 41.0.0 | GitHub Advisory Database |
| electronjs electron | before 38.8.6, from 39.0.0 before 39.8.1, from 40.0.0 before 40.8.1, 41.0.0 | NVD |
All scores
| GitHub_M | 4.7medium CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N |
| GitHub | 4.7medium CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
Classification
What each source says
CVE List
Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to versions 38.8.6, 39.8.1, 40.8.1, and 41.0.0, 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. This issue has been patched in versions 38.8.6, 39.8.1, 40.8.1, and 41.0.0.
GitHub Advisory Database
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
NVD (es)
Electron es un framework para escribir aplicaciones de escritorio multiplataforma usando JavaScript, HTML y CSS. Antes de las versiones 38.8.6, 39.8.1, 40.8.1 y 41.0.0, en Windows, app.setAsDefaultProtocolClient(protocol) no validaba el nombre del protocolo antes de escribir en el registro. Las aplicaciones que pasan entrada no confiable como nombre del protocolo pueden permitir a un atacante escribir en subclaves arbitrarias bajo HKCU\Software\Classes\, potencialmente secuestrando controladores de protocolo existentes. Las aplicaciones solo se ven afectadas si llaman a app.setAsDefaultProtocolClient() con un nombre de protocolo derivado de entrada externa o no confiable. Las aplicaciones que usan un nombre de protocolo codificado de forma rígida no se ven afectadas. Este problema ha sido parcheado en las versiones 38.8.6, 39.8.1, 40.8.1 y 41.0.0.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-34773 changed 2026-04-06 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-mwmh-mq4g-g6gr changed 2026-04-06 | CC-BY-4.0 |
| NVD | CVE-2026-34773 changed 2026-07-24 | Public domain |