Skip to content
RCE Write-up Advanced

CVE-2020–9854: “Unauthd” - (three) logic bugs ftw!

Three logic bugs in macOS allowed a local user to escalate to root and then to kernel: authd failed to validate code signatures before trusting entitlements, an Apple-signed package ran a script from a writable path, and kextutil had a race between signature verification and loading. An attacker could gain root and load unsigned kernel extensions, bypassing SIP.

Ilias Morad Follow

Published on objective-see.com

In this guest blog post, security researcher Ilias Morad aka A2nkF, describes a lovely exploit chain, composed of several security vulnerabilities he uncovered in macOS. This chain creates a local privilege escaltion (LPE), from user all the way to the kernel!

Ilias Morad (@A2nkF_), on objective-see.com

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 multiple logic flaws: missing code signature validation before reading entitlements, a package script executed from a user-writable path, and a time-of-check-to-time-of-use race in kextutil.

What the attacker needed

Local user access; macOS < 10.15.5; ability to codesign binaries

The fix

Apple fixed the first bug by adding code validity checks inside SecCodeCopySigningInformation; the text does not state fixes for the other two.

How it was found

  1. Create an entitlement file with the desired right.
  2. Write a program that waits, then requests the right from authd.
  3. While the program waits, codesign it with the entitlement file.
  4. Use the obtained right to install an Apple-signed package to a non-SIP location.
  5. Exploit a postinstall script that runs a binary from a writable path to get root and SIP bypass.
  6. Use kextutil -interactive to load a modified kernel extension, overwriting it after verification.

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.

This is about a chain of three mistakes in macOS that let a normal user become the all-powerful root user and even run code in the kernel (the core of the operating system). The first mistake was that a security service trusted a program's claimed permissions without checking the program was genuine. The other two mistakes let the attacker replace files after they had been checked, so malicious code ran with high privileges.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Ilias Morad

View all

2 more disclosed reports, best first.

More from Apple

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.