Skip to content
Race condition Advisory Advanced CVE-2020-9839

(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.

Yonghwi Jin Follow

Originally disclosed on Zero Day Initiative

High 7.8 View original

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.

@jinmo123, @setuid0x0_, and @insu_yun_en of @SSLab_Gatech, on the Zero Day Initiative

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.

More by Yonghwi Jin

View all

3 more disclosed reports, best first.

More from Zero Day Initiative

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.