5.4medium
Electron: Incorrect origin passed to permission request handler for iframe requests
- Severity
- 5.4medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.14% (higher than 3% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-r5p7-gp4j-qhrx
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, when an iframe requests fullscreen, pointerLock, keyboardLock, openExternal, or media permissions, the origin passed to session.setPermissionRequestHandler() was the top-level page's origin rather than the requesting iframe's origin. Apps that grant permissions based on the origin parameter or webContents.getURL() may inadvertently grant permissions to embedded third-party content. The correct requesting URL remains available via details.requestingUrl. Apps that already check details.requestingUrl 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 | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| GitHub | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
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, when an iframe requests fullscreen, pointerLock, keyboardLock, openExternal, or media permissions, the origin passed to session.setPermissionRequestHandler() was the top-level page's origin rather than the requesting iframe's origin. Apps that grant permissions based on the origin parameter or webContents.getURL() may inadvertently grant permissions to embedded third-party content. The correct requesting URL remains available via details.requestingUrl. Apps that already check details.requestingUrl 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
When an iframe requests fullscreen, pointerLock, keyboardLock, openExternal, or media permissions, the origin passed to session.setPermissionRequestHandler() was the top-level page's origin rather than the requesting iframe's origin. Apps that grant permissions based on the origin parameter or webContents.getURL() may inadvertently grant permissions to embedded third-party content.
The correct requesting URL remains available via details.requestingUrl. Apps that already check details.requestingUrl are not affected.
Workarounds
In your setPermissionRequestHandler, inspect details.requestingUrl rather than the origin parameter or webContents.getURL() when deciding whether to grant fullscreen, pointerLock, keyboardLock, openExternal, or media permissions.
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, cuando un iframe solicitaba permisos de fullscreen, pointerLock, keyboardLock, openExternal o media, el origen pasado a sesión.setPermissionRequestHandler() era el origen de la página de nivel superior en lugar del origen del iframe solicitante. Las aplicaciones que otorgan permisos basándose en el parámetro de origen o webContents.getURL() pueden otorgar permisos inadvertidamente a contenido de terceros incrustado. La URL solicitante correcta permanece disponible a través de details.requestingUrl. Las aplicaciones que ya verifican details.requestingUrl 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-34777 changed 2026-04-06 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-r5p7-gp4j-qhrx changed 2026-04-06 | CC-BY-4.0 |
| NVD | CVE-2026-34777 changed 2026-07-24 | Public domain |