Skip to content
RCE Write-up Advanced

Electron Windows Protocol Handler MITM/RCE (bypass for CVE-2018-1000006 fix)

The patch for CVE-2018-1000006 in Electron's Windows protocol handler used a blacklist that omitted the host-rules flag, allowing an attacker to redirect Chromium traffic to a malicious host. An attacker could perform a man-in-the-middle attack to steal data or, with nodeIntegration enabled, achieve remote code execution.

blog.doyensec.com

Published on blog.doyensec.com

As part of an engagement for one of our clients, we analyzed the patch for the recent Electron Windows Protocol handler RCE bug (CVE-2018-1000006) and identified a bypass.

Luca Carettoni, on blog.doyensec.com

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 blacklist-based validation of command-line arguments was incomplete and missed the host-rules flag, which allows rewriting domain names for Chromium requests.

Impact

An attacker could intercept Chromium traffic to steal confidential data such as OAuth tokens, and with nodeIntegration enabled could inject malicious HTML to achieve remote code execution; however, only Chromium traffic is affected, not Node, so Electron's update feature is not impacted.

What the attacker needed

Victim uses a vulnerable Electron app on Windows; App registers a custom protocol handler; Registry entry lacks dash-dash; Victim visits attacker's web page

The fix

Electron released an improved blacklist in v2.0.1, v1.8.7, and v1.7.15, and developers are recommended to enforce a dash-dash notation in setAsDefaultProtocolClient or the registry entry.

How it was found

  1. The attacker hosts a web page containing JavaScript that sets window.location to a custom protocol URL with a crafted argument.
  2. The victim visits the malicious page in a browser.
  3. The browser launches the registered Electron app (e.g., Skype) with the crafted arguments.
  4. The host-rules flag causes Chromium traffic to be redirected to the attacker's domain.
  5. The attacker intercepts traffic and can steal data or inject malicious responses.

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 on Windows can register custom URL schemes (like myapp://). When a victim visits a malicious page, the page can launch the app with extra command-line options. The fix tried to block dangerous options with a list, but missed one that lets an attacker redirect the app's web traffic to their own server, enabling eavesdropping or code execution.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.