Unbreaking the iPhone: Bootchain Reversal, SEP Sabotage, and the iOS Kernel Frontier

Jack Sessions

BSides Canberra VIII (2025) · Day 1 · Off-Main Track

Overview

In this highly engaging and technically rich presentation at BSides Canberra, Jack Sessions delves into the intricate security mechanisms of Apple's iOS ecosystem, challenging the pervasive notion of the iPhone as an "unhackable" device. Titled "Unbreaking the iPhone: Bootchain Reversal, SEP Sabotage, and the iOS Kernel Frontier," the talk provides a deep exploration of iOS architecture, from the hardware-enforced secure boot process to the elusive Secure Enclave Processor (SEP) and kernel-level protections. Sessions, a mobile security researcher, adeptly navigates complex topics such as bootchain vulnerabilities, pointer authentication codes, sandboxing, and code signing, illustrating how these mechanisms, while robust, can be meticulously analyzed and potentially circumvented by determined adversaries.

Watch on YouTube

Visual summary for Unbreaking the iPhone: Bootchain Reversal, SEP Sabotage, and the iOS Kernel Frontier by Jack Sessions
Visual summary for Unbreaking the iPhone: Bootchain Reversal, SEP Sabotage, and the iOS Kernel Frontier by Jack Sessions

Key moments

  1. 0:00 Introduction: Unbreaking the iPhone talk overview
  2. 4:00 Why iOS? The reality of Apple's 'secure' phones
  3. 10:00 Deep dive into the Secure Enclave Processor (SEP)
  4. 22:00 Live demo: Deciphering iOS boot logs and processes
  5. 34:00 Kernel panic logs: The 'gold standard' for research
  6. 37:00 Demo: Achieving persistent surveillance with XML daemons
  7. 42:00 Future of iOS research and breaking the SEP
  8. 47:00 Unforgettable PSP rap battle finale

Unbreaking the iPhone: Bootchain Reversal, SEP Sabotage, and the iOS Kernel Frontier

Speakers: Jack Sessions

Conference: BSides Canberra

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

Overview

In this highly engaging and technically rich presentation at BSides Canberra, Jack Sessions delves into the intricate security mechanisms of Apple's iOS ecosystem, challenging the pervasive notion of the iPhone as an "unhackable" device. Titled "Unbreaking the iPhone: Bootchain Reversal, SEP Sabotage, and the iOS Kernel Frontier," the talk provides a deep exploration of iOS architecture, from the hardware-enforced secure boot process to the elusive Secure Enclave Processor (SEP) and kernel-level protections. Sessions, a mobile security researcher, adeptly navigates complex topics such as bootchain vulnerabilities, pointer authentication codes, sandboxing, and code signing, illustrating how these mechanisms, while robust, can be meticulously analyzed and potentially circumvented by determined adversaries.

The presentation distinguishes itself through its blend of detailed technical explanations, live demonstrations (leveraging Corellium for iOS virtualization), and a refreshingly candid, meme-infused delivery style. Sessions aims to demystify the "walled garden" of iOS security, revealing the critical information asymmetry that often favors state-sponsored actors and well-funded groups like NSO Group, whose Pegasus spyware routinely targets iOS devices. By showcasing how kernel panics can be leveraged for exploit development and how persistence can be achieved through manipulating core system daemons, the talk underscores the continuous cat-and-mouse game between Apple's security engineers and the research community.

This article dissects Sessions' key insights, providing a structured overview of the iOS security landscape and the practical attack vectors discussed. It emphasizes the importance of understanding Apple's layered defenses for both offensive and defensive security practitioners, advocating for increased public research and knowledge sharing to counter the inherent secrecy of the iOS ecosystem. Ultimately, Sessions' talk serves as a powerful reminder that no system is truly impenetrable, and continuous scrutiny is vital for true security.

Background

▶ Watch: Introduction: Unbreaking the iPhone talk overview (0:00)

The perception of iOS as the "most secure phone" is a double-edged sword. While Apple has implemented sophisticated hardware and software protections, the closed-source nature of the ecosystem creates an information asymmetry. This means that detailed knowledge of vulnerabilities and exploitation techniques often remains hidden, primarily benefiting well-resourced adversaries such as nation-states and mercenary spyware vendors like NSO Group, responsible for the notorious Pegasus spyware. These entities exploit zero-day vulnerabilities, which, due to their high value, are rarely disclosed publicly. This secrecy hinders independent security research and leaves defenders at a disadvantage.

Understanding the foundational architecture of iOS is paramount to identifying and exploiting weaknesses. The core of iOS security is built upon a hardware-enforced trust anchor known as Secure Boot. This process ensures that each stage of the boot sequence verifies the cryptographic signature of the next, preventing unauthorized code execution from the earliest moments of device startup. If any signature check fails, the device refuses to boot, entering a kernel panic state.

Central to Secure Boot is the Secure ROM, the first code executed on the system, immutably stored on the System on a Chip (SoC). It verifies the low-level bootloader. Vulnerabilities in Secure ROM are particularly critical because they are "forever exploitable," as demonstrated by the Checkm8 vulnerability, which exploited a boot ROM flaw in older A-series chips, allowing persistent control over the boot chain. The boot chain itself follows a strict progression: Secure ROM -> Low-level Bootloader -> iBoot -> Kernel -> Userland. Breaking any link in this chain grants forward control, making it easier to compromise subsequent stages.

The Secure Enclave Processor (SEP) is Apple's dedicated hardware security module, isolated from the main CPU. It manages cryptographic keys, biometric data (Face ID, Touch ID), and payment information. The SEP runs its own firmware, and its cryptographic material is designed to be ephemeral and protected by anti-replay features. Critically, the SEP provides minimal logs, making its internal workings opaque and difficult for researchers to analyze without a jailbroken device.

Further layers of protection include KTRR (Kernel Text Read-Only Region), which prevents tampering with kernel memory, and PAC (Pointer Authentication Codes), an ARM v8.3-A hardware extension designed to thwart classic Return-Oriented Programming (ROP) and Jump-Oriented Programming (JOP) attacks by cryptographically signing pointers. While PAC significantly raises the bar for kernel exploitation, bypasses through key leakage, brute-force, or logical bugs are known to exist.

At the application level, entitlements define the permissions an app is granted to access private APIs and system features (e.g., network access, microphone). These entitlements are enforced by sandboxing, which isolates apps from each other and from critical system resources, preventing lateral movement and restricting an app's access to only its designated files and data. However, a successful sandbox escape can grant an attacker unrestricted access to system resources and serve as a powerful persistence mechanism.

Finally, code signing is a fundamental security measure, requiring every binary on an iOS device to be cryptographically signed by Apple. This is enforced by the AMFI (Apple Mobile File Integrity) daemon, which prevents unsigned or malicious code from executing. Jailbreaks typically work by patching AMFI to allow unsigned code to run, highlighting the daemon's critical role in maintaining system integrity. The persistent discovery of memory corruption bugs, as seen in recent CVE lists for iOS, iPadOS, and macOS, underscores the ongoing challenge of securing this complex architecture.

Key Findings

▶ Watch: Deep dive into the Secure Enclave Processor (SEP) (10:00)

Jack Sessions' talk illuminated several key findings regarding the state of iOS security and the methodologies employed by both researchers and adversaries:

  • Information Asymmetry Fuels Exploitation: The speaker consistently highlighted that Apple's closed ecosystem fosters an environment where knowledge of iOS vulnerabilities and exploit techniques is hoarded by a select few, particularly state-sponsored groups and mercenary spyware vendors. This "security by obscurity" creates a significant disadvantage for independent researchers and defenders, making it harder to protect against sophisticated attacks like Pegasus.
  • Kernel Panics as a "Gold Standard" for Research: Sessions demonstrated that reliably triggering a kernel panic is an invaluable technique for iOS security researchers. The resulting kernel panic logs provide a wealth of information, including memory addresses, UUIDs, iBoot versions, zone maps, CPU core memory states, thread counts, and driver information. This data is critical for understanding the kernel's state at the point of failure, enabling researchers to map memory layouts and develop targeted exploits.
  • Layered Hardware and Software Protections are Not Impenetrable: Despite sophisticated mechanisms like Secure Boot, SEP, KTRR, and PAC, Sessions showed that vulnerabilities can still be found. The Checkm8 boot ROM exploit serves as a prime example of a hardware-level flaw that is "forever exploitable." Similarly, while PAC makes ROP/JOP harder, bypasses exist, indicating that even cutting-edge hardware protections can be overcome.
  • Persistence is Achievable and Covert: The talk detailed how attackers can achieve persistent footholds on iOS devices by manipulating system launch daemons using simple XML property lists. This allows arbitrary code execution on boot, effectively establishing a persistent backdoor. Furthermore, Sessions demonstrated how attackers can actively resist Digital Forensics and Incident Response (DFIR) efforts by wiping system logs, making detection and investigation significantly more challenging.
  • Neglected Attack Surfaces Offer High Reward: Sessions emphasized that complex, highly privileged components like GPU drivers and the baseband/radio stack (which runs its own real-time operating system) represent significant, often overlooked, attack surfaces. Exploiting these can lead to kernel read/write access or even full device ownership, allowing man-in-the-middle capabilities without needing storage access. The difficulty of researching these areas means fewer eyes on them, potentially leading to more potent vulnerabilities.
  • The "Most Secure" Narrative is Misleading: Sessions directly challenged the marketing narrative of iOS as the "most secure" mobile platform, arguing it is more accurately described as the "most closed source." This distinction is crucial, as obscurity does not equate to security. The lack of transparency and difficulty in conducting public research means that vulnerabilities can persist undetected for longer, making the platform a high-value target for covert operations.

Technical Deep Dive

▶ Watch: Kernel panic logs: The 'gold standard' for research (34:00)

The technical core of Sessions' talk revolved around dissecting the layers of iOS security and identifying potential points of compromise.

At the lowest level, the Secure Boot process is a chain of trust. The immutable Secure ROM first verifies the Low-Level Bootloader (LLB), which then validates iBoot, and so on, until the kernel and userland are loaded. Each stage requires cryptographic signatures from Apple. A critical insight is that while breaking a link grants control forward in the chain, reversing control to an earlier, more privileged stage is exceedingly difficult. The Checkm8 vulnerability, which exploited a boot ROM bug, exemplifies how a silicon-level flaw can provide persistent, unpatchable control over the boot process, affecting devices up to iPhone X.

The Secure Enclave Processor (SEP) was highlighted as a black box of security. Isolated from the main CPU, it handles sensitive operations like cryptographic key generation, biometric data processing, and secure payments. Sessions explained the internal flow: data from NAND flash storage passes through a flash controller, then an AES cryptographic engine, managed by the Application Processor (AP), before reaching the memory protection engine and finally the SEP. A key challenge for researchers is the SEP's design philosophy: it provides virtually no logs unless the device is jailbroken. This intentional opacity makes reverse engineering and vulnerability discovery exceptionally challenging, as attackers lack visibility into its firmware and input handling. The SEP also incorporates secure nonvolatile storage, meaning certain cryptographic material, once set, can never be altered.

Sessions then moved to kernel-level protections: KTRR (Kernel Text Read-Only Region) and PAC (Pointer Authentication Codes). KTRR hardens the kernel against memory tampering by marking critical regions as read-only. PAC, an ARM v8.3-A hardware extension, adds cryptographic signatures to pointers, aiming to prevent classic code reuse attacks like ROP and JOP. Attackers must now either leak the cryptographic keys used for PAC, brute-force them, or find logical bugs in the PAC implementation itself. Sessions noted that while PAC significantly raises the bar, bypasses do exist, indicating that no protection is absolute.

Application security relies heavily on entitlements and sandboxing. Entitlements are granular permissions embedded within an application's binary, dictating its access to private APIs and system resources (e.g., com.apple.private.network-delegate for network access). These are processed within a sandbox profile, which strictly isolates applications from each other and the underlying system. Safari, for instance, cannot directly access Mail's files. However, a successful sandbox escape allows an attacker to bypass these restrictions, gaining broad access to system resources, read/write storage, make calls, and establish persistence.

The final layer of integrity discussed was code signing, enforced by the AMFI (Apple Mobile File Integrity) daemon. Every executable binary on an iOS device must be signed by Apple. AMFI validates these signatures at runtime, preventing the execution of unsigned or malicious code. This is why jailbreaks typically involve patching AMFI to allow the execution of arbitrary, unsigned code, fundamentally altering the device's security posture.

Beyond these foundational elements, Sessions delved into specific high-value attack surfaces:

  • GPU Drivers: These are notoriously complex, highly privileged, and a common source of memory corruption vulnerabilities. Gaining control over GPU drivers can grant immediate kernel read/write access, historically chained for persistence.
  • Baseband and Radio Stack: Running on its own real-time operating system, the baseband handles all wireless communication (SMS, Wi-Fi, LTE, Bluetooth). It's often neglected by researchers due to its complexity, but a compromise here offers profound control, allowing attackers to own the phone without needing storage access, effectively performing a man-in-the-middle attack on the device's communications. Sessions highlighted the evolution from iPhone SE (single baseband chip, vulnerable to JTAG) to iPhone 8 (multiple chips, validated by SEP) as Apple's response to these threats.

Sessions' own experience included developing a "deterministic kernel exploit" that reliably caused a kernel panic, which Apple patched shortly before the talk. This demonstrated the practical application of causing kernel panics to gain insights into memory states for exploit development.

Demo / Proof of Concept

▶ Watch: Demo: Achieving persistent surveillance with XML daemons (37:00)

Jack Sessions incorporated several live demonstrations, primarily utilizing Corellium (an ARM virtualization platform) and command-line interactions, to illustrate his technical points. While acknowledging the inherent unreliability of live demos and Corellium's occasional connectivity issues, he successfully showcased critical aspects of iOS security.

  1. SEP Logs (Among Us OS): Sessions began by attempting to retrieve logs from the Secure Enclave Processor. As anticipated, the demo illustrated that by design, the SEP provides no logs on a standard device. This reinforced the point that the SEP's opaque nature is a significant barrier for researchers and attackers alike, making it difficult to understand its internal workings without a jailbroken device or specialized tools. He then showed a brief snippet of code, noting that the daemon responsible for SEP interaction is a critical point of interest.
  1. Boot Logs (North Korean Operating System): This demo provided a deep dive into the verbose output generated during an iOS device's boot process. Scrolling through thousands of lines of log data captured from a Corellium instance, Sessions highlighted several key elements:
  • Daemon Configuration Service: This dictates which processes run and which do not upon boot, as defined by Apple.
  • OS Environment and RAM Disk: The RAM disk was identified as a crucial component for jailbreaks, as controlling it provides a foothold in the boot chain's volatile memory.
  • Ignition Sequence Complete: This marker signifies a successful boot.
  • NVME Model Adapter: The storage component initiating its boot checks.
  • Service Initialization: Thousands of services are initialized, with "failure to bootstrap" being a notable log entry on jailbroken devices, indicating an attempt to bypass file integrity checks.
  • Bluetooth Module: Showing the PCIe driver for the Bluetooth chip, emphasizing how such low-level drivers can be attack surfaces.
  • PList (Process List): The underlying mechanism that determines which processes are allowed to run.
  1. Kernel Panic Logs (Bernie Sanders): Sessions presented pre-captured kernel panic logs, which he described as the "gold standard" for iOS research. He meticulously walked through the information contained within these logs:
  • Memory Addresses: Crucial for identifying specific locations in memory that can be targeted for corruption.
  • Kernel UUID and iBoot Version: Providing context about the specific device and firmware, useful for identifying known vulnerabilities.
  • Time and Zone Information: Especially the zone map, which describes how memory is managed in blocks, allowing an attacker to repeatedly target specific memory regions.
  • CPU Cores and Thread Count: Indicating the system's state and active processes at the time of panic.
  • Driver Information: Details about USB-C, Bluetooth, and other drivers, which can reveal potential vulnerabilities in their implementation.
  • Mobile Function Manager: A particularly interesting component, as compromising it could provide a built-in persistence mechanism by controlling what functions are allowed to run.
  1. Persistence Mechanism (Hannah Montana Linux): This demonstration, though not live due to Wi-Fi issues with Corellium, showed an XML property list (.plist) that could be used to create a persistent launch daemon. The plist structure included:
  • Key Label: e.g., com.bsides.demo.
  • ProgramArguments: Executing /bin/bash (for Corellium's environment).
  • StandardOutPath: Redirecting output to persistence.txt.

The speaker explained that once this plist is written to the appropriate system directory, the specified command will execute every time the device reboots, effectively creating a stealthy and persistent foothold. He humorously noted, "Once you're a daemon, you can become a demon."

  1. DFIR Resistance (Covert iOS Attacks): Sessions demonstrated a simple yet effective technique for erasing forensic evidence. By echoing text (cat hello bsides) into the system log file (/var/log/system.log) and then using rm -var log system.log, he showed how an attacker could delete log entries, making it harder for incident responders to trace their actions. This highlighted how sophisticated attackers can achieve "fully covert installs" by combining sandbox escapes with log manipulation.

Defensive Implications

▶ Watch: Unforgettable PSP rap battle finale (47:00)

The insights shared by Jack Sessions offer crucial guidance for defenders operating within or against the iOS ecosystem. The primary defensive implication stems from countering the information asymmetry that currently favors attackers.

  1. Challenge the "Walled Garden" Mentality: Defenders must shed the notion that iOS devices are inherently "unhackable" simply because they are closed-source. This "security by obscurity" can lead to complacency. Instead, assume that sophisticated adversaries possess zero-day exploits and are actively targeting iOS.
  2. Focus on Telemetry and Anomaly Detection: Apple itself uses telemetry to detect compromised devices. Defenders should leverage similar principles. Monitor for unusual system behavior, unexpected process launches, modifications to system files (especially launch daemons), and any indications of AMFI bypasses (e.g., unsigned code execution). Standard logging and off-device log aggregation become even more critical, given attackers' ability to wipe local logs.
  3. Harden Against Supply Chain and Sideloading Risks: The talk highlighted enterprise provisioning abuse and sideloading as common vectors for advanced spyware. Organizations should strictly control developer certificates, mobile device management (MDM) profiles, and the installation of non-App Store applications. Implementing robust application whitelisting and integrity checks is paramount.
  4. Understand High-Value Attack Surfaces: Defenders need to be aware of the critical, often neglected, attack surfaces like GPU drivers and the baseband/radio stack. While direct monitoring of these low-level components is challenging, understanding their potential for kernel compromise should inform threat models and incident response plans. The ability of baseband exploits to bypass storage-based defenses necessitates a focus on network-level monitoring and device-level integrity checks that go beyond file system analysis.
  5. Prioritize Patch Management: Despite the existence of zero-days, applying Apple's security updates promptly remains the most effective defense against known vulnerabilities. Many attacks rely on exploiting publicly patched flaws.
  6. Enhance DFIR Capabilities for iOS: Recognize that attackers can actively resist forensic efforts by wiping logs and employing covert payloads. Incident responders need specialized tools and methodologies to recover deleted data, analyze memory dumps (if obtainable), and detect subtle indicators of compromise that persist even after log erasure. The wealth of information in kernel panic logs, for example, can be leveraged defensively if captured.
  7. Advocate for Transparency and Research: While individual defenders may have limited influence, collectively, the security community should advocate for greater transparency from Apple regarding security mechanisms and bug bounty programs. More public research, as Sessions encouraged, strengthens the overall ecosystem by bringing more eyes to complex problems. Utilizing tools like Corellium for emulation and testing can help defenders proactively understand attack vectors.

Key Takeaways

  • iOS is not unhackable; it's closed-source: The perception of ultimate security is misleading. The "walled garden" primarily benefits well-resourced attackers by limiting public research and knowledge sharing.
  • Kernel panics are a goldmine for researchers: Reliably triggering kernel panics provides invaluable logs containing memory addresses, system states, and driver information, crucial for mapping memory and developing exploits.
  • Persistence is achievable and can be covert: Attackers can establish persistent footholds on iOS devices by manipulating launch daemons via XML property lists and can actively resist DFIR by wiping system logs.
  • High-privilege, complex components are prime targets: GPU drivers and the baseband/radio stack represent significant, often overlooked, attack surfaces that can lead to kernel compromise or full device ownership.
  • The secure boot chain and SEP are robust but not absolute: While hardware-enforced trust anchors like Secure ROM and the Secure Enclave Processor are formidable, vulnerabilities (like Checkm8) and sophisticated bypass techniques exist.
  • More public research is crucial: To counter the information asymmetry, the security community needs more researchers focusing on iOS to expose vulnerabilities and share knowledge, moving beyond the current "guildmanship" model.

About the Speaker(s)

Jack Sessions is a computer science student and mobile security researcher specializing in forensics and counter-intelligence. He describes himself as "still broke" and actively seeking employment, notably hoping Ubisoft will hire him for Watch Dogs 4. Sessions is also a rap battle enjoyer, a cyber security YouTuber with 21 subscribers (at the time of the talk), and a self-proclaimed "failed SoundCloud rapper." He humorously noted that he is "not yet on an Interpol watch list, probably," highlighting his adventurous approach to security research. His presentation style is characterized by a blend of deep technical knowledge, engaging humor, and a passionate call for more open research in the iOS security space.

Reviews

→ Top-rated talks at BSides Canberra VIII (2025)

All talks from BSides Canberra VIII (2025)