How Twitch Helper Can Be Used for Privilege Escalation
The privileged helper tool com.twitch.LauncherHelper, installed by Twitch Studio, accepts XPC connections without any validation and exposes a file-move method that runs as root. An attacker could use this method to overwrite the helper binary with their own code, which launchd would then execute as root, leading to privilege escalation.
Published on kandji.io
Privileged helpers are bits of software that assist applications by running elevated privileged actions separate from the app itself. XPC is Apple’s interprocess communication mechanism that makes this possible.
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
The helper's XPC listener did not validate or authorise incoming connections, and it exposed a file-move method that ran with root privileges.
Impact
An attacker could escalate privileges to root on a Mac where the Twitch Studio helper remains installed, even if the app itself was removed.
What the attacker needed
Twitch Studio helper installed; local access to the Mac
The fix
The helper should validate and authorise XPC connections before accepting them, and users should remove the leftover LaunchDaemon plist and helper binary.
How it was found
- Connect to the helper's XPC service using the exposed protocol.
- Call the installFromPath:toPath:withReply: method to move a controlled binary over the helper binary at /Library/PrivilegedHelperTools/com.twitch.LauncherHelper.
- Trigger launchd to start the replaced helper, which executes the controlled binary as root.
- The controlled binary adds a line to the sudoers file, allowing any account to use sudo without a password.
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.
A privileged helper is a small program that runs with high permissions to help a main app do things it cannot do itself. On macOS, apps talk to these helpers using XPC, a system for sending messages between programs. Here, the helper accepted messages from anyone without checking who sent them, and one of its commands let the sender move a file anywhere as the all-powerful root user. An attacker could replace the helper with their own program, which the system would then run with full control.
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.