Skip to content
Access control Write-up Advanced

ELECTRONizing macOS privacy

Electron apps on macOS inherit user-granted TCC privacy permissions, and if the app has the EnableNodeCliInspectArguments fuse enabled, an attacker can use the --inspect flag to execute arbitrary JavaScript in the app's context and spawn a child process that inherits those permissions.

Wojciech Reguła Follow

Published on wojciechregula.blog

In 2019 I wrote a blog post about injecting code to Electron apps to impersonate their TCC permissions. The trick was really simple because at that time the only thing an attacker had to do was to modify one of the Electron app’s HTML files or the whole ASAR.

Wojciech Reguła, on wojciechregula.blog

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 TCC permission inheritance for user-granted permissions and the EnableNodeCliInspectArguments fuse being enabled, which allows the --inspect flag to expose a DevTools API for code execution.

What the attacker needed

Target Electron app has EnableNodeCliInspectArguments…; Attacker can run the app with the --inspect flag; Attacker can access the local web socket

How it was found

  1. Check the target Electron app's fuses to see if EnableNodeCliInspectArguments is enabled.
  2. Use the --inspect flag to turn on the DevTools API on a local web socket.
  3. Access the DevTools API with a Chromium-based browser to execute arbitrary JavaScript in the app's context.
  4. Use JavaScript to spawn a child process that inherits the app's TCC permissions.

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.

TCC is macOS's privacy system that asks your permission before apps can access things like your camera or files. Electron apps are built with web technology and can be told to start in a debugging mode that lets someone run code inside them. Because the app already has your permission, any program it starts also gets that permission, so an attacker can use the debugging mode to run their own program with the app's access.

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.

More by Wojciech Reguła

View all

7 more disclosed reports, best first.

More from Apple (macOS)

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.