(Pwn2Own) Apple macOS cfprefsd Time-Of-Check Time-Of-Use Privilege Escalation Vulnerability
A local attacker with low-privileged code execution could exploit a time-of-check time-of-use flaw in macOS cfprefsd's handling of file permissions to escalate privileges to root. The vulnerability arises from a lack of proper locking during operations on an object.
Originally disclosed on Zero Day Initiative
This vulnerability allows local attackers to escalate privileges on affected installations of Apple macOS. An attacker must first obtain the ability to execute low-privileged code on the target system in order to exploit this vulnerability.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a time-of-check time-of-use race condition due to missing locking when handling file permissions in cfprefsd.
Impact
An attacker could escalate privileges and execute code as root, but only after first obtaining low-privileged code execution on the target.
What the attacker needed
Low-privileged code execution on target
The fix
Apple addressed the vulnerability in a security update, as referenced in the vendor advisory.
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 report has not been written yet. The Original tab links to the source.
This is a local privilege escalation bug in macOS. A program running with normal user permissions can trick a system service (cfprefsd) into giving it root access because the service checks permissions at one moment but uses the file later without locking, allowing a race condition. An attacker who already has a foothold on the machine could become the superuser.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.