Finding Vulnerabilities in Apple packages at Scale

Csaba Fitzl

Security Fest 2025 · Day 1 · Main Stage

Overview

This talk by Csaba Fitzl, a Principal macOS Security Researcher at Jamf, delves into the intricate world of macOS security, specifically focusing on the vulnerabilities found within Apple-signed software packages. Fitzl, a veteran bug hunter with close to 100 CVEs reported to Apple, presented a systematic approach to identifying and exploiting weaknesses in the systeminstalld daemon, which is responsible for installing these critical packages. The research highlights that despite macOS's robust security model, older, signed packages distributed through Apple's software update catalog can harbor "forever day" vulnerabilities, allowing attackers to bypass fundamental security mechanisms like System Integrity Protection (SIP) and Transparency, Consent, and Control (TCC).

Watch on YouTube

Visual summary for Finding Vulnerabilities in Apple packages at Scale by Csaba Fitzl
Visual summary for Finding Vulnerabilities in Apple packages at Scale by Csaba Fitzl

Key moments

  1. 0:00 Introduction and talk agenda
  2. 2:00 Apple security model: Root is not god mode
  3. 4:00 Entitlements and granular security explained
  4. 6:00 System Integrity Protection (SIP) / Rootless explained
  5. 8:00 Introduction to systeminstalled daemon
  6. 8:30 Powerful 'rootless install heritable' entitlement explained

Finding Vulnerabilities in Apple packages at Scale

Speakers: Csaba Fitzl, Principal macOS Security Researcher, Jamf

Conference: Security Fest

YouTube: https://www.youtube.com/watch?v=8nUNZVAtl94

Overview

This talk by Csaba Fitzl, a Principal macOS Security Researcher at Jamf, delves into the intricate world of macOS security, specifically focusing on the vulnerabilities found within Apple-signed software packages. Fitzl, a veteran bug hunter with close to 100 CVEs reported to Apple, presented a systematic approach to identifying and exploiting weaknesses in the systeminstalld daemon, which is responsible for installing these critical packages. The research highlights that despite macOS's robust security model, older, signed packages distributed through Apple's software update catalog can harbor "forever day" vulnerabilities, allowing attackers to bypass fundamental security mechanisms like System Integrity Protection (SIP) and Transparency, Consent, and Control (TCC).

Fitzl's work is particularly significant because it addresses a unique challenge in the Apple ecosystem: the inability to revoke certificates for older, vulnerable packages without disrupting a vast user base. His methodology, which leveraged AI tools like ChatGPT for large-scale automation, allowed him to analyze thousands of packages and uncover several critical flaws. The talk not only details these vulnerabilities but also sheds light on Apple's sophisticated, operating-system-level mitigations designed to neutralize these threats without invalidating existing package signatures. This research is crucial for macOS users, administrators, and security professionals to understand the subtle yet powerful attack vectors that can undermine core system protections.

Background

▶ Watch: Introduction and talk agenda (0:00)

The macOS security model is fundamentally different from traditional Unix-like operating systems, despite its POSIX heritage from FreeBSD. A key distinction is that root access on macOS does not equate to "god mode." Unlike other systems where root can perform any action, macOS imposes several layers of security that restrict even root users. These layers include:

  • Sandbox: A traditional application sandbox that containerizes applications, limiting their access to specific locations and resources.
  • Transparency, Consent, and Control (TCC): Apple's privacy framework, responsible for the ubiquitous pop-ups asking for permission to access resources like the microphone, camera, desktop, documents, and downloads. TCC can deny access even to root processes if the user has not granted permission.
  • System Integrity Protection (SIP) (also known as Rootless): A global sandbox that protects core system resources, preventing modification of critical system files and directories, even by the root user. Some specific entitlements can provide limited bypasses.
  • Entitlements: Granular rights embedded within a code signature that grant very specific privileges to a process, such as permission to interact with other processes, write to specific locations, or install kernel drivers. Most powerful entitlements are private to Apple and cannot be added by third-party developers.
  • Code Signing: The root of trust in macOS and iOS. All applications and system components are signed, either by Apple or by developers with certificates issued by Apple, establishing a chain of trust. On Apple Silicon, even ad-hoc signing is mandatory.

macOS also features multiple security boundaries: from a standard user to an admin, from admin to root, and from root to the kernel. This granular approach means that gaining root privileges is often just one step in a multi-stage attack to achieve true system control. Process injection is generally disallowed, even between processes running under the same user.

The focus of this research is systeminstalld, a critical root daemon responsible for installing packages signed directly by Apple. This daemon possesses powerful entitlements, notably com.apple.rootless.install.heritable, which allows it to modify SIP-protected files. The "heritable" aspect means that any process spawned by systeminstalld (e.g., a shell script) inherits this potent right, making it a prime target for privilege escalation.

Apple packages typically consist of two main parts: the files to be installed and pre- and post-installation scripts. These scripts, executed by systeminstalld with elevated privileges, often perform tasks like stopping applications, deleting old versions, or backing up data. Exploiting these scripts is the primary attack vector for systeminstalld vulnerabilities.

The ultimate goal of the exploitation techniques demonstrated in this talk is to achieve a TCC bypass, specifically by modifying the com.apple.TCC.append.plist file (also known as the "hello application list PList"). This configuration file, historically used as an extra privacy database, could be manipulated to grant an attacker's terminal full disk access, effectively bypassing TCC protections and accessing all private user data. This specific PList was removed in macOS Sonoma, but the underlying vulnerability types remain relevant.

Past vulnerabilities in systeminstalld and package installation have included:

  • 2019 (Jerham Bradley): Package swapping during installation.
  • Undated: Executing attacker-controlled binaries overwritten during installation.
  • 2021 ("Rootless" by Jonathan Baror, Microsoft): Modifying /etc/zprofile to inject commands.
  • Undated: Insecure file copies or hard link creation in post-install scripts.
  • Mickey Gene's research: Focused on exploiting the internal framework of systeminstalld itself, rather than external package scripts.

These prior works established a precedent for exploiting package installation processes, but Fitzl's research aimed for a more systematic, large-scale discovery.

Key Findings

▶ Watch: Entitlements and granular security explained (4:00)

Csaba Fitzl's research yielded several significant findings:

  1. Vast Untapped Vulnerability Surface: The Apple Software Update (SU) catalog, a public resource used by macOS to list all available packages, contains a massive repository of over 10,000 packages, totaling approximately 1.33 terabytes of data. This catalog, going back to macOS Leopard, represents a significant and often overlooked attack surface.
  2. AI-Assisted Automation for Scale: Fitzl successfully leveraged ChatGPT to automate the tedious and complex process of parsing the SU catalog, downloading packages, and filtering them. This demonstrated the utility of AI in security research for scaling operations that would be unmanageable manually.
  3. Discovery of New and Undocumented Vulnerabilities: From the filtered set of 300-400 packages, Fitzl discovered five distinct vulnerabilities. Three of these were newly reported to Apple (CVEs not specified in the talk), while two others were found to be previously fixed but undocumented, highlighting gaps in public knowledge about past mitigations.
  4. Persistent "Forever Day" Vulnerabilities: A critical finding is that even when Apple fixes a vulnerability in a package and releases a new version, older, vulnerable versions remain digitally signed. Since Apple cannot revoke these certificates without breaking a vast number of installations, these old packages represent "forever day" vulnerabilities that can still be exploited through downgrade attacks or by simply using the older package.
  5. Operating System-Level Mitigations: Apple has developed a sophisticated strategy to mitigate these "forever day" issues at the operating system level, rather than by altering the signed packages themselves. These mitigations, implemented within the PackageKit framework, dynamically modify the installer's behavior or even the script content before execution, effectively neutralizing the vulnerabilities without requiring certificate revocation.

Technical Deep Dive

▶ Watch: System Integrity Protection (SIP) / Rootless explained (6:00)

The core of Fitzl's research revolved around systematically analyzing Apple's Software Update (SU) catalog. This catalog, an XML-formatted property list file, lists all software products available from Apple for various macOS versions, dating back over 15 years. Each product entry in the catalog includes a unique key, metadata URL, and crucially, the URL and size of the package files (.pkg) themselves. This catalog is commonly monitored by macOS system administrators for new updates.

To tackle the immense scale of this catalog, Fitzl, despite acknowledging his weakness in automation, turned to ChatGPT. His methodology involved several steps, iteratively refined with the AI:

  1. Catalog URL Acquisition: ChatGPT was tasked with scraping a GitHub page that tracks all SU catalog URLs, successfully parsing the content to retrieve the full list.
  2. Package Download and Initial Assessment: The AI then helped parse the XML structure of each catalog to extract all package URLs. This revealed a staggering 1.33 terabytes of data across approximately 10,000 unique packages.
  3. Initial Filtering – Script Presence: The first manual filtering step was to eliminate packages that did not contain any pre- or post-installation scripts, as these were the primary target for vulnerabilities.
  4. Filtering – Unsupported Packages: Packages designed for older macOS versions that installed files into the now read-only /System partition were removed, as systeminstalld would reject them.
  5. Filtering – Default Scripts: Packages containing only generic, non-vulnerable default logging scripts were discarded.
  6. Filtering – Non-Package Files: Various .p, .tar, and .zip files found in the catalog that were not standard macOS packages or contained very old, uninteresting package formats were removed.
  7. Filtering – Printer Packages: A large number of printer packages containing only PostScript Printer Description (PPD) files and a single, non-vulnerable script were filtered out.

These automated and semi-automated filtering steps reduced the initial 10,000+ packages to a manageable 300-400 for manual analysis, which further revealed duplicates, bringing the effective number down to around 150-200. This highly focused set was then manually scrutinized, leading to the discovery of five distinct vulnerabilities.

Vulnerability #1: IDVD Extra Content Package (SIP Bypass)

  • Location: iDVD Extra Content.pkg
  • Scripts: Contained a pre-install script (move teams aside) and a post-install script (copy teams back).
  • Mechanism: These scripts were designed to back up existing iDVD "themes" (located in /Library/Application Support/iDVD/Teams), install new ones, and then restore the backed-up themes. The crucial flaw was that these operations occurred in a user-controllable location (/Library/Application Support/iDVD/Teams), despite systeminstalld running as root with SIP bypass privileges.
  • Exploitation: The attacker could create a symbolic link (symlink) at the Teams folder location, pointing to a SIP-protected target, such as the com.apple.TCC.append.plist file (e.g., /Library/Application Support/com.apple.TCC.append.plist). Concurrently, the attacker would place their malicious hello application list.plist (containing the desired TCC bypass entry for full disk access) into the move aside backup folder. When the post-install script executed the dtto (copy) command, it would copy the attacker's file from the move aside location through the symbolic link to the SIP-protected target, effectively achieving a full SIP and TCC bypass.

Vulnerability #2: Printer Installer (File Overwrite / Denial of Service)

  • Location: A generic printer installer package.
  • Script: A simple script that wrote log output to a temporary file in /tmp, specifically /tmp/gp.co_Canon_MacOps_Installer_pskill.log.
  • Mechanism: The /tmp directory is globally writable.
  • Exploitation: An attacker could create a symbolic link at the expected log file path in /tmp, redirecting the output to a SIP-protected but non-core system file, such as XProtect (macOS's built-in malware scanner). While the attacker couldn't control the content written to the file, overwriting XProtect effectively disables a critical security feature, leading to a denial-of-service condition for the malware scanner.

Vulnerability #3: Recovery HD Update (TCC/SIP Bypass)

  • Location: RecoveryHDUpdate.pkg
  • Script: The replace recovery script, operating within the /tmp directory.
  • Mechanism: This script involved extracting a .dmg file (disk image) using pkgutil and then mounting it using hdidutil. Both the extracted .dmg and its mount point were within /tmp. This setup created a race condition.
  • Exploitation:
  1. The pkgutil command extracts the legitimate .dmg to /tmp.
  2. The attacker detects the script running, then pauses (kill -STOP) the perl process executing the script.
  3. The attacker replaces the legitimate .dmg with their own malicious .dmg (containing a pre-crafted TCC database).
  4. The attacker replaces the intended mount point directory with a symbolic link pointing to the actual TCC database location (e.g., /Library/Application Support/com.apple.TCC.db).
  5. The perl process is resumed (kill -CONT).
  6. When hdidutil attempts to mount the disk image, it mounts the attacker's .dmg over the symlinked TCC database, effectively dropping the malicious database in place.
  7. To prevent the script from unmounting the .dmg (which would revert the change), the attacker kills (kill -KILL) the perl process after detecting the mount.
  8. Finally, the TCCD daemon is restarted to ensure the new database is loaded. This achieves a full SIP and TCC bypass.

Vulnerability #4: Undocumented Fixed Vulnerability (SIP Bypass via Command Injection)

  • Location: Contained an alert_all_install.sh script.
  • Mechanism: This script used the USER environment variable in the sudo_user_alert_target command, making it susceptible to command injection.
  • Exploitation: By setting the USER environment variable during the installer invocation (e.g., USER="root; arbitrary_command;" installer -pkg ...), an attacker could inject arbitrary commands. The exploit specifically injected a command to overwrite the com.apple.TCC.append.plist file, granting full disk access. This vulnerability was fixed by Apple but was not publicly documented with a CVE.

Vulnerability #5: Undocumented Fixed Vulnerability (SIP Bypass via Arbitrary File Extraction)

  • Location: A package that copied and extracted a .pex (compressed) file.
  • Mechanism: The script copied a .pex file from a user-controllable location and extracted it to a specified destination. Both the source .pex file and the destination path were controllable.
  • Exploitation: Similar to previous symlink attacks, the attacker could replace the legitimate .pex file with a malicious one and use a symbolic link to redirect the extraction destination to a SIP-protected location (e.g., the com.apple.TCC.append.plist). This was demonstrated on macOS Ventura, indicating it was fixed long ago, but again, without public documentation.

Demo / Proof of Concept

▶ Watch: Introduction to systeminstalled daemon (8:00)

The demonstrations for these vulnerabilities followed a consistent pattern, illustrating the impact of the SIP and TCC bypasses. For each relevant exploit, Fitzl showcased:

  1. Initial State: A terminal application running without full disk access. Attempts to list files from a protected directory (like the Desktop) would result in a "permission denied" error, even when running as root, demonstrating the effectiveness of TCC. The com.apple.TCC.append.plist was shown to be empty or not granting the desired access.
  2. Exploit Execution: The custom exploit script was executed, which typically involved installing the vulnerable package while simultaneously setting up symbolic links or managing race conditions as described in the technical deep dive.
  3. Post-Exploitation State: After the installation completed, the terminal application was shown to have gained full disk access. This was confirmed by successfully listing the contents of the previously protected Desktop directory. The com.apple.TCC.append.plist was shown to be updated with the attacker's desired entry.

Specific demos included the iDVD Extra Content Package exploit and the Recovery HD Update race condition exploit, both clearly demonstrating the ability to achieve full disk access for the terminal, thereby bypassing SIP and TCC.

Defensive Implications

▶ Watch: Powerful 'rootless install heritable' entitlement explained (8:30)

The discovery of "forever day" vulnerabilities in Apple-signed packages presents a unique challenge for defense. Because these packages are legitimately signed by Apple, their certificates cannot simply be revoked without causing widespread disruption and breaking countless existing installations. This means that even if a new, fixed version of a package is released, older vulnerable versions can still be used for exploitation, particularly in downgrade scenarios or by attackers who simply download the older package.

Apple's response to this challenge has been to implement sophisticated, operating-system-level mitigations within the PackageKit framework, which is used by systeminstalld. These mitigations dynamically alter the behavior of systeminstalld or even the scripts themselves before execution, effectively neutralizing the vulnerabilities without requiring changes to the signed packages. Fitzl detailed three primary types of these configuration files:

  1. InstallScriptActions: This configuration file allows Apple to define specific scripts within particular packages that should have their SIP bypass privileges dropped (drop_sip) before execution. By specifying the relative path of a script and the package identifier, systeminstalld is instructed to downgrade its own privileges for that script, preventing it from modifying SIP-protected locations. This effectively prevents the exploits from achieving their desired impact.
  2. InstallScriptMutations: This is a more granular and less frequently used mitigation. It allows Apple to apply hot patches to scripts on the fly. By specifying a script name and using a regular expression, PackageKit can replace vulnerable content within a script with corrected content before it is executed. Fitzl noted this was used for only one package he reported, indicating it's reserved for specific, complex cases.
  3. InstallScriptTraits: This is the broadest and most recent mitigation. It simply states that if a specific package identifier is encountered, systeminstalld should drop_sip privileges entirely for the duration of that package's installation, regardless of which scripts are being run. This implies that many packages likely contained vulnerabilities at some point, and rather than tracking individual scripts, Apple opted for a blanket privilege drop.

For defenders, the primary implication is the importance of keeping macOS updated to the latest versions. These OS-level mitigations are continuously deployed through system updates, ensuring that even if an attacker attempts to install an old, vulnerable package, the operating system will intervene to prevent exploitation. Furthermore, understanding that even root access on macOS is constrained by SIP and TCC is crucial. While these vulnerabilities target systeminstalld to overcome these protections, the underlying principle of granular security remains a core defensive posture.

Key Takeaways

  • macOS Security is Complex: The macOS security model, with its granular privileges, SIP, TCC, and entitlements, means that root access alone is not "god mode" and multiple security boundaries exist.
  • systeminstalld is a Critical Target: As a root daemon with powerful, heritable SIP bypass entitlements, systeminstalld is a high-value target for privilege escalation through vulnerable package scripts.
  • Apple's SU Catalog is a Vulnerability Goldmine: The vast, publicly available Software Update catalog contains thousands of old, Apple-signed packages that can harbor "forever day" vulnerabilities due to the inability to revoke certificates.
  • Automation is Essential for Scale: AI tools like ChatGPT can significantly enhance security research by automating tedious tasks such as catalog parsing, package downloading, and initial filtering, enabling researchers to analyze massive datasets.
  • Symbolic Links and Race Conditions Remain Potent: Many of the discovered vulnerabilities leveraged classic attack techniques like symbolic link manipulation and race conditions within package installation scripts to redirect file operations to protected locations.
  • Apple's OS-Level Mitigations are Sophisticated: Rather than revoking certificates, Apple mitigates "forever day" vulnerabilities by dynamically modifying systeminstalld's behavior or scripts at the operating system level through InstallScriptActions, InstallScriptMutations, and InstallScriptTraits within the PackageKit framework.

About the Speaker(s)

Csaba Fitzl is a Principal macOS Security Researcher at Jamf, a leading MDM solution provider for Mac devices that also develops security EDR products. Prior to his role at Jamf, Csaba worked at Offensive Security, where he developed the EXP312 macOS exploitation training. He has extensive experience as both a red teamer and a blue teamer. Csaba is a prolific macOS bug hunter, having reported close to 100 CVEs to Apple. Outside of his professional life, he is married with two children and enjoys trail running and hiking.

All talks from Security Fest 2025