Open Sesame: Escalating Open Redirect to RCE with Electron Code Review
An Electron application enabled nodeIntegration and exposed a custom URL scheme that loaded whitelisted domains, but an open redirect on the whitelisted domain allowed loading an attacker page. That page could execute native code via the exposed nodeRequire, leading to remote code execution.
Published on spaceraccoon.dev
For better or worse, Node.js has rocketed up the developer popularity charts. Thanks to frameworks like React, React Native, and Electron, developers can easily build clients for mobile and native platforms.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the combination of nodeIntegration being enabled and a custom URL scheme that trusted a domain with an open redirect, allowing arbitrary code execution.
Impact
An attacker could escalate an open redirect to remote code execution in the Electron app.
What the attacker needed
Victim has the vulnerable Electron app installed; An open redirect exists on a whitelisted domain
How it was found
- Identify an open redirect on the whitelisted domain.
- Escalate the open redirect to execute code.
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 write-up has not been written yet. The Original tab links to the source.
Electron apps are desktop programs built with web technology. If a setting called nodeIntegration is on, any JavaScript running in the app can also run native commands on your computer. The researcher found a way to make the app load a malicious web page, which then ran such commands.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.