Skip to main content

Overview

macOS privilege escalation combines traditional Unix techniques with Apple-specific attack vectors. This page covers user-interaction-based escalation, social engineering, and recent macOS-specific vulnerabilities.
This content is for authorized penetration testing and security research only.

TCC Privilege Escalation

TCC (Transparency, Consent, and Control) controls application access to sensitive resources. TCC privilege escalation is covered separately — this page focuses on traditional root escalation.

User Interaction Techniques

Sudo PATH Hijacking

macOS preserves the user’s PATH when executing sudo, unlike many Linux distributions. This allows hijacking binaries in Homebrew paths:
Users with Homebrew installed (most developers) are particularly vulnerable since /opt/homebrew/bin is typically at the front of their PATH.

Password Prompt Phishing + sudo Reuse

Malware frequently captures a sudo-capable password and reuses it programmatically:

Dock Impersonation

Replace the legitimate Chrome entry in the Dock with a fake app that steals the user’s password:
Finder cannot be removed from the Dock — place a fake Finder adjacent to the real one:
Alternatively, make fake Finder request to copy to /etc/pam.d (triggers a legitimate-looking password prompt).

Newer macOS-Specific Vectors (2023–2025)

This API was deprecated in 10.7 but still functions on current macOS. Many commercial updaters call /usr/libexec/security_authtrampoline with attacker-controllable paths:
If a LaunchDaemon plist or its ProgramArguments target is user-writable:
A race in kauth_cred_proc_update allows corrupting the read-only credential pointer (proc_ro.p_ucred) by racing setgid()/getgid() loops across threads until a torn memcpy occurs. Successful corruption yields uid 0.
This is a reliable local kernel privesc on vulnerable builds without SIP bypass requirements.
Abuses the Migration Assistant entitlement com.apple.rootless.install.heritable to spawn a child process that inherits SIP bypass capability:
  1. Obtain root on a live system
  2. Trigger systemmigrationd with crafted state to run an attacker-controlled binary
  3. Use inherited entitlement to write to SIP-protected paths (e.g., /System/Library/LaunchDaemons)
  4. Persistence survives reboot
Multiple Apple daemons accept NSPredicate objects over XPC and only validate expressionType, which is attacker-controlled. Crafting a predicate that evaluates arbitrary selectors achieves code execution in root/system XPC services (e.g., coreduetd, contextstored).When combined with an initial sandbox escape, this grants privilege escalation without user prompts.

TCC Root Privilege Escalation

CVE-2020-9771 — mount_apfs TCC Bypass

Any user (even unprivileged) can mount a Time Machine snapshot with noowners and access all files:
The only privilege required is that the Terminal app (or whatever tool is used) must have Full Disk Access (FDA) — kTCCServiceSystemPolicyAllfiles.

Sensitive Files for Privilege Escalation

Key locations worth examining on macOS:

References