Skip to content
Race condition Write-up Advanced

The Nightmare of Apple's OTA Update: Bypassing the Signature Verification and Pwning the Kernel

The macOS OTA update process moved the downloaded package into a SIP-protected location while leaving a time window in which a root user could swap files, and the signature check on the package manifest followed a symbolic link, so a tampered package could pass verification. An attacker with root could then remove arbitrary SIP-protected paths and, on Intel Macs without a T2 chip, inject a crafted kernel patch to run code at ring 0.

Mickey Jin Follow

Published on jhftss.github.io

This blog post is written for my talk at OBTS v6.0.

Mickey's Blogs, on jhftss.github.io

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 the package manifest was opened by path without blocking symbolic links, so the file verified by the signature check and the file used to verify the rest of the package could be swapped between check and use.

Impact

A root attacker could bypass SIP and, on Intel Macs without a T2 chip, inject shellcode into the kernel and execute arbitrary code at ring 0; other Macs were limited by Secure Boot.

What the attacker needed

Root access on the target Mac; ability to monitor update logs; an OTA update in progress

The fix

Apple changed the digest calculation to open the manifest without following symbolic links, and later copied package contents to an intermediate path so the final files inherit restrictions.

How it was found

  1. Copy the original payload.bom to a controlled location outside the protected path.
  2. Watch the update log and, when the move keyword appears, replace payload.bom with a symbolic link to the controlled copy.
  3. Let the symbolic link be moved into the trusted location.
  4. After the signature check passes, overwrite the controlled BOM file so every other package item can be tampered with.
  5. Use the tampered package to remove SIP-protected paths or to apply a crafted kernel patch.

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.

When your Mac installs a small system update, it downloads a package and checks a list of file fingerprints to make sure nothing was changed. The check read that list through a shortcut (a symbolic link) that an attacker with administrator rights could repoint, so the check passed while the real files were altered. That let the attacker change protected system files and, on some older Macs, the kernel itself.

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 Mickey Jin

View all

113 more disclosed reports, best first.

More from Apple (macOS)

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.