CVE-2020–9854: "Unauthd"
A logic flaw in authd allowed a local user to codesign a binary with arbitrary entitlements without validity checks, granting rights such as system.install.apple-software. This enabled installation of Apple-signed packages to non-SIP locations, leading to root code execution and a SIP bypass, and a race condition in kextutil allowed loading unsigned kernel extensions.
Published on objective-see.org
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!
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 authd called SecCodeCopySigningInformation without first calling SecCodeCheckValidity, so it accepted entitlements from a binary whose signature was not verified.
Impact
A local user could gain root privileges and bypass SIP, and with a race condition in kextutil, load unsigned kernel extensions, achieving kernel code execution.
What the attacker needed
Local user access; macOS < 10.15.5
The fix
Apple fixed the first bug by implementing code validity checks in SecCodeCopySigningInformation, and the report implies the other issues were addressed by patches released in macOS 10.15.6.
How it was found
- Create an entitlement file with the desired right.
- Write a program that waits, then requests the right from authd.
- While the program waits, codesign it with the entitlement file.
- Observe authd logs showing the entitlement was accepted.
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 report describes a chain of three bugs in macOS that let a normal user become root and even run code in the kernel. The first bug is that a security service trusted a program's claimed permissions without checking the program's signature, so an attacker could fake those permissions. The other bugs then abused package installation and kernel extension loading to escalate further.
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.