Skip to content
Race condition Write-up Advanced

Diving into an Old Exploit Chain and Discovering 3 new SIP-Bypass Vulnerabilities

The postinstall script of an Apple-signed package used an arbitrary install destination volume path, allowing an attacker to drop a malicious payload that would be executed in a SIP-Bypass context. By ejecting the DMG volume at the right moment, the volume path check could be bypassed, leading to arbitrary script execution with SIP bypass.

Mickey Jin Follow

Published on trendmicro.com

More than two years ago, a researcher, A2nkF demonstrated the exploit chain from root privilege escalation to SIP-Bypass up to arbitrary kernel extension loading. In this blog entry, we will discuss how we discovered 3 more vulnerabilities from the old exploit chain.

Mickey Jin (@patch1t), on trendmicro.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 the installer trusted a user-controlled volume path and later a restricted-directory check that could be raced or bypassed via environment variables, allowing script execution in a SIP-bypass context.

Impact

An attacker could execute arbitrary scripts with SIP bypass, potentially leading to arbitrary kernel extension loading, though the exploit requires winning a race condition and local access.

What the attacker needed

Local access to run installer; ability to mount DMG volumes; race condition timing

How it was found

  1. Create a malicious post-install script and mount a DMG volume.
  2. Use the installer command to install an Apple-signed package to the DMG volume.
  3. Monitor for the creation of the post-install script in the DMG volume.
  4. Eject the DMG volume immediately and recreate the same directory on the root volume.
  5. Move the prepared payload script into the directory.
  6. Wait for the payload script to be executed in a SIP-Bypass context.

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.

System Integrity Protection (SIP) is a macOS security feature that stops even root from modifying protected system files. This report shows that a script run during software installation could be tricked into running an attacker's code with SIP turned off, because the script trusted a path that the attacker could control. The attacker uses a disk image and timing tricks to make the installer run their script in that powerful context.

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.