Disabling context isolation, nodeIntegrationInSubFrames using an unauthorised frame.
Electron's renderer process could be manipulated to enable nodeIntegrationInSubFrames and disable context isolation, allowing a compromised renderer to access IPC and communicate with the main process. This could lead to remote code execution if sensitive IPC handlers exist.
- Fixed in 3 days
- Paid in 3 days
- Disclosed after 20 days
Summary by the program
Compromised child renderer processes could obtain IPC access without nodeIntegrationInSubFrames being enabled
Affected versions: < 15.5.5 || >= 16.0.0-beta.1 < 16.2.6 || >= 17.0.0-beta.1 < 17.2.0 || >= 18.0.0-beta.1 < 18.0.0-beta.6
Patched versions: 15.5.5, 16.2.6, 17.2.0, 18.0.0-beta.6
Impact This vulnerability allows a renderer with JS execution to obtain access to a new renderer process with nodeIntegrationInSubFrames enabled which in turn allows effective access to ipcRenderer.
Please note the misleadingly named nodeIntegrationInSubFrames option does not implicitly grant Node.js access rather it depends on the existing sandbox setting. If your application is sandboxed then nodeIntegrationInSubFrames just gives access to the sandboxed renderer APIs (which includes ipcRenderer).
If your application then additionally exposes IPC messages without IPC senderFrame validation that perform privileged actions or return confidential data this access to ipcRenderer can in turn compromise your application / user even with the sandbox enabled.
Patches This has been patched and the following Electron versions contain the fix:
18.0.0-beta.6 17.2.0 16.2.6 15.5.5
Workarounds Ensure that all IPC message handlers appropriately validate senderFrame as per our security tutorial here.
For more information If you have any questions or comments about this advisory, email us at [email protected].
GHSA Link: https://github.com/electron/electron/security/advisories/GHSA-mq8j-3h7h-p8g7
Summary by the researcher
Summary Here is the TL;DR of this bug.
- Electron patches blink WebPreferences and adds settings like node_integration_sub_frames, context_isolation, etc.
- If node_integration_in_sub_frames or on WebPreferences is true, then expose preload contextBridge API.
https://github.com/electron/electron/blob/bd10b19b0cdc46cdbadb570af89305e64541b679/shell/renderer/electron_sandboxed_renderer_client.cc#L217 3. You can notice that the check is on the renderer process. 4. Using renderer exploit we can flip node_integration_in_sub_frames to 1 😈 .
Furthermore, We can do the same for context_isolation and disable context_isolation on a window and pollute Electron Internals to leak Electron Internal modules like IPC, shell etc.,
The report
Details can be found in the following github advisory: https://github.com/electron/electron/security/advisories/GHSA-mq8j-3h7h-p8g7
Impact
Using a renderer exploit, context isolation and nodeIntegrationInSubFrames can be disabled, which enables an attacker to leak IPC module and communicate with the more privileged main process which might eventually lead to Remote Code Execution if there are sensitive IPC handlers on main process.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the security settings (nodeIntegrationInSubFrames and contextIsolation) were checked in the renderer process itself, allowing a compromised renderer to flip them.
Impact
An attacker with renderer code execution could gain IPC access and potentially achieve remote code execution if the main process has sensitive IPC handlers without sender validation.
What the attacker needed
Renderer code execution; sandbox may be enabled
The fix
The vulnerability was fixed in Electron versions 15.5.5, 16.2.6, 17.2.0, and 18.0.0-beta.6.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Electron apps have a main process and renderer processes (like browser tabs). Renderers are supposed to be isolated from the main process for security. This bug let an attacker who already had code execution in one renderer turn off that isolation, giving them a way to talk to the main process and potentially run harmful commands.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.