Reading between the patches: Getting started with iOS security

Billy Ellis (Vulnerability Researcher, iOS Security, Reverse Engineer)

Objective for the We v4.0 (#OFTW) 2026 · Day 2 · Main Stage

Overview

In this comprehensive talk, Billy Ellis, an experienced iOS vulnerability researcher, provides an insightful introduction to the complex world of iOS security. The presentation is designed as a quick-start guide for individuals interested in deep system research, vulnerability analysis, and exploit development on Apple's mobile platform. Ellis demystifies the iOS security landscape, outlining both Apple's robust defensive mechanisms and the methodologies employed by attackers to circumvent them.

Watch on YouTube · Slides

Visual summary for Reading between the patches: Getting started with iOS security by Billy Ellis
Visual summary for Reading between the patches: Getting started with iOS security by Billy Ellis

Key moments

  1. 0:00 Introduction and talk overview
  2. 1:00 iOS security model: boot, code signing, sandboxing
  3. 6:00 Attacker's perspective: components of an exploit chain
  4. 17:40 Setting up your iOS security research environment
  5. 21:30 Patch diffing: a practical hands-on beginner task
  6. 23:50 Walkthrough: Analyzing an ImageIO integer overflow vulnerability
  7. 34:50 Q&A: Speaker's favorite elegant exploit (Pegasus)

Reading between the patches: Getting started with iOS security

Speakers: Billy Ellis, Vulnerability Researcher, iOS Security, Reverse Engineer

Conference: Objective for the We

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

Overview

In this comprehensive talk, Billy Ellis, an experienced iOS vulnerability researcher, provides an insightful introduction to the complex world of iOS security. The presentation is designed as a quick-start guide for individuals interested in deep system research, vulnerability analysis, and exploit development on Apple's mobile platform. Ellis demystifies the iOS security landscape, outlining both Apple's robust defensive mechanisms and the methodologies employed by attackers to circumvent them.

The talk progresses from theoretical discussions of the iOS security model and typical exploit chains to practical guidance on setting up a modern research environment. Ellis culminates his presentation with a hands-on demonstration of patch diffing, a fundamental technique for discovering and understanding patched vulnerabilities. His expertise, honed over a decade of iOS research and professional work in kernel and sandbox escape exploitation, shines through in the detailed breakdown of technical concepts and real-world examples.

This article aims to distill Ellis's invaluable insights, offering a structured exploration of iOS security that covers its foundational pillars, the anatomy of an exploit chain, essential research tools, and a practical deep dive into vulnerability discovery. For anyone looking to embark on or deepen their journey into iOS security, this talk serves as an indispensable resource, bridging the gap between high-level concepts and actionable technical understanding.

Background

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

Apple's iOS platform is renowned for its stringent security posture, built upon a multi-layered defense model. Billy Ellis highlights three foundational pillars that have underpinned iOS security since its early days: Secure Boot Chain, Code Signing, and Sandboxing.

The Secure Boot Chain is the first line of defense, initiating verification from the moment an iPhone powers on. The Boot ROM, a immutable piece of code baked into the hardware, uses a public key to establish a chain of trust. Each subsequent boot loader component, up to the kernel, is cryptographically verified to ensure its authenticity and integrity, guaranteeing that the running firmware originates from Apple and has not been tampered with. Any deviation results in a boot loop or recovery mode, with only extremely rare boot ROM exploits capable of bypassing this initial check.

Following a secure boot, Code Signing enforces that all executables in user space are validly signed by Apple. This kernel-enforced mechanism prevents unauthorized code execution and tampering, as even a single instruction modification will cause an application to be terminated. Code signing is also intrinsically linked to entitlements, which grant applications specific privileges or access to system resources. These entitlements are tied to the code signature, preventing their arbitrary modification by an attacker. Recent additions like the Trusted Execution Monitor (TXM) and Secure Page Table Monitor (SPTM) further bolster kernel security by acting as a "kernel within the kernel," handling sensitive operations related to page tables and code signing.

Sandboxing, a common security paradigm across modern operating systems, isolates processes and restricts their access to the wider system. By default, applications are denied access to risky attack surfaces, instead requiring them to communicate through proxy processes to interact with sensitive kernel drivers or system components. This fine-grained control is enforced in the kernel via Mac F hooks, which intercept syscalls and validate actions against an application's specific sandbox profile. These profiles, written in a declarative language, explicitly whitelist allowed operations, embodying a "default deny" security posture. Beyond these core pillars, modern iOS versions integrate hardware-specific mitigations such as KTRR (Kernel Task Register Read/Write protection), which prevents modification of kernel code after boot.

From an attacker's perspective, the goal is typically to deploy a full-chain exploit, often a one-click or zero-click remote compromise, to gain privileged code execution. This involves chaining together multiple vulnerabilities to overcome Apple's security features. Ellis outlines a typical exploit chain comprising three distinct stages: Remote Code Execution (RCE), Sandbox Escape, and Local Privilege Escalation (LPE), often synonymous with a kernel exploit. Successfully navigating these stages theoretically allows an attacker to run unsigned code or an implant binary on the device.

Key Findings

▶ Watch: Attacker's perspective: components of an exploit chain (6:00)

Ellis meticulously details the typical components and attack surfaces involved in an iOS exploit chain, highlighting the evolution of techniques and the increasing complexity introduced by modern mitigations.

Remote Code Execution (RCE) serves as the initial entry point, allowing an attacker to gain a foothold on the device. The primary attack surfaces for RCE include:

  • Browser Memory Corruption: Exploits in WebKit, Apple's browser engine, are common. Attackers aim to achieve memory read/write primitives within the browser process, often by crafting unusual JavaScript to confuse the JavaScript interpreter or JIT compiler. The unique characteristic of browser processes being allowed read-write-execute (R-W-X) memory pages for JIT compilation makes them attractive targets, simplifying the execution of shellcode for subsequent exploit stages compared to environments requiring return-oriented programming (ROP).
  • Media Parsing Corruptions: Vulnerabilities in how messaging apps or the browser parse various media formats (images, videos, audio, PDFs, fonts, proprietary formats like PK pass) are a significant vector. These can lead to zero-click exploits where simply receiving a malicious file (e.g., an image thumbnail rendering in a notification banner) triggers the vulnerability without user interaction. Ellis cites historical examples such as the NSO Group's exploit of a JBIG2 format bug, the WebP vulnerability, and more recent DNG parsing issues in WhatsApp.
  • Other Remote Vectors: Less common but still relevant are vulnerabilities in components like Bluetooth or AirDrop. For jailbreaking contexts, third-party apps can act as a substitute for RCE, voluntarily installing an application containing the next stage of the exploit.

Once RCE is achieved, the attacker often finds themselves within a highly restricted sandbox environment. A Sandbox Escape is frequently required to gain access to broader system resources or more critical kernel attack surfaces. While not always necessary (e.g., the 2015 Pegasus chain or Operation Triangulation's Safari exploit directly hit the kernel via commonly accessible Mach syscalls or IOKit functions), it is a common intermediate step. The strategy involves identifying a userland process (e.g., Process A) that possesses a more permissive sandbox profile, allowing access to specific kernel drivers (e.g., Kernel Driver Class B). The attacker then exploits an Inter-Process Communication (IPC) bug to compromise Process A, effectively "upgrading" their context and gaining access to Process A's allowed kernel interfaces.

The ultimate goal of many exploit chains is a Kernel Exploit, granting kernel memory read/write capabilities. This level of control is often considered "game over" for the device, although Ellis notes that modern hardware-backed mitigations like TXM and SPTM introduce additional layers that must be bypassed to run truly unsigned applications. Kernel exploit targets include:

  • BSD Syscalls: Traditional operating system calls related to networking or file access.
  • Mach Side of the Kernel: Components dealing with virtual memory management and IPC ports.
  • Kernel Extensions (KEXTs): Various device drivers that have historically been a source of vulnerabilities.

Ellis emphasizes that the reality of modern iOS exploitation is far more complex due to pervasive mitigations. Pointer Authentication (PA), for instance, affects nearly every component and often requires its own sophisticated bypasses. Future devices, such as the hypothetical "iPhone 17," are expected to introduce Memory Integrity Enforcement, further limiting the types of bugs usable for exploitation.

A key finding and recommendation from Ellis is that patch diffing is an ideal starting point for aspiring iOS security researchers. This technique involves comparing two successive versions of iOS firmware to identify patched security vulnerabilities. It directly engages with reverse engineering, vulnerability analysis, and understanding exploit primitives, making it an excellent hands-on learning method.

Technical Deep Dive

▶ Watch: Setting up your iOS security research environment (17:40)

Setting up an effective iOS research environment is crucial for hands-on vulnerability analysis and exploit development. Billy Ellis outlines the primary options for test devices and essential software tools.

For test devices, researchers have three main choices:

  1. Physical iPhones: These offer a one-to-one mapping, ensuring research conducted on the test device directly reflects real-world behavior. However, obtaining jailbreaks for modern iOS versions is challenging, often limiting researchers to older, jailbreakable devices (e.g., those vulnerable to the checkra1n boot ROM exploit). While core kernel components don't drastically change, researching the latest iOS features or mitigations on physical devices can be difficult.
  2. Virtual Phones: Solutions like Corellium provide full iPhone virtualization, while projects like VPhone CLI allow self-hosting a virtual iOS instance on a Mac. The advantages are significant: unrestricted debugging capabilities (including kernel debugging), the ability to run processes as root with arbitrary entitlements, support for any iOS version (even future ones like "iOS 27"), and scalability for large-scale fuzzing. The primary downside is that virtualized environments may not perfectly replicate all specific iPhone hardware components or their associated kernel extensions.
  3. ARM64 Macs: Modern Macs featuring Apple Silicon (M1, M2, etc.) share a common chipset and a substantial portion of their codebase with iOS. This allows researchers to work directly on macOS, with much of the knowledge and techniques transferable to iOS. Macs offer robust debugging capabilities, root access, and arbitrary entitlement usage. Similar to virtual phones, some iPhone-specific hardware and software components might be absent.

Essential software tools for iOS research include:

  • Disassemblers/Decompilers: Tools like IDA Pro are indispensable for reverse engineering closed-source iOS kernel components and userland frameworks.
  • checkra1n and pongoOS: For physical devices, the checkra1n boot ROM exploit, combined with the pongoOS pre-boot environment, provides unparalleled control, enabling kernel instrumentation and loading custom patches.
  • Other Tools: Ellis mentions various other useful tools without specific names, implying a standard toolkit for binary analysis and debugging.

Ellis then provides a practical, hands-on example of patch diffing a real-world vulnerability, illustrating the entire process from discovery to proof-of-concept. The chosen vulnerability is an Image IO bug (a CVE from iOS 26.5, patching an issue present in 26.4.2), credited to Yuri and Annie Addison. Image IO is Apple's primary user-space framework for image parsing, making it a critical component for potential messaging app exploits. The CVE description indicated that processing a maliciously crafted image could corrupt process memory, signaling a promising target for memory corruption.

The patch diffing process involved:

  1. Firmware Acquisition: Downloading the iOS 26.5 (patched) and iOS 26.4.2 (vulnerable) firmware files from ipsw.me.
  2. Binary Analysis: Loading the ImageIO binary from both firmwares into IDA Pro.
  3. Diffing: Using a plugin like bindiff for IDA Pro to compare the two binary databases and identify modified functions between the versions.
  4. Vulnerability Identification: Among the changed functions, Ellis focused on EXR_read_plugin_decode_block_AppleEXR. The function name itself provided clues, indicating its role in OpenEXR image format decoding, precisely where parsing bugs are expected.
  5. Root Cause Analysis: Comparing the decompiled code of the vulnerable (26.4.2) and patched (26.5) versions revealed a critical difference: the patched version included an integer overflow check for a multiplication operation, which was missing in the prior version.
  • The multiplication involved four values: width height 4 * channel_count. Ellis determined that width, height, and channel_count (which could be set to 4) were controllable by the attacker through the EXR image metadata.
  • By supplying absurdly large width and height values (e.g., with channel_count of 4), the multiplication would result in an integer overflow. Specifically, a large input could cause the 32-bit result to become 0 while the true value should have been much larger.
  • This "overflow-to-zero" result was then used as the size argument for a malloc call. Surprisingly, malloc(0) on iOS does not return a null pointer but instead allocates the smallest possible buffer, typically 8 bytes.
  • Later in the decoding pipeline, the actual image pixel data, which would be significantly larger, was copied into this tiny 8-byte buffer, leading to a massive heap overflow and subsequent memory corruption.

This detailed technical breakdown illustrates how a seemingly simple missing check can lead to a critical memory corruption primitive, a cornerstone for building more complex exploits.

Demo / Proof of Concept

▶ Watch: Walkthrough: Analyzing an ImageIO integer overflow vulnerability (23:50)

To demonstrate the discovered Image IO vulnerability, Billy Ellis outlined the steps to trigger a crash using a crafted OpenEXR image. The goal was to prove that the integer overflow and subsequent heap overflow could indeed lead to observable system instability.

Reaching the Vulnerability:

The EXR_read_plugin_decode_block_AppleEXR function, being part of the Image IO framework, is widely used across iOS. Ellis mentions two primary methods to interact with it:

  1. Custom Harness: A dedicated program can be written to directly call into the relevant Image IO functions, such as a render_that_draw_image function. This approach offers precise control and is often preferred for debugging specific code paths. Ellis referenced a useful harness code snippet available for this purpose.
  2. System Applications: Any application that uses Image IO for rendering, such as the Photos app on iOS or the Preview app on macOS, can serve as a vector.

Crafting the Malicious Image:

The core of the proof-of-concept (PoC) involved creating a specially crafted OpenEXR image file. This image was designed with extremely large width and height dimensions and a channel_count of 4, specifically engineered to trigger the integer overflow within the EXR_read_plugin_decode_block_AppleEXR function. No other complex manipulations were required for the initial crash.

Demonstrated Crash:

When the malicious EXR image was processed by either the custom harness or a vulnerable system application, it consistently resulted in a crash. The call stack clearly showed the vulnerable function (EXR_read_plugin_decode_block_AppleEXR) as the origin of the issue. The crash itself occurred slightly later in the execution flow, manifesting as a classic memory access violation involving 0x41414141 bytes. This pattern strongly indicates a heap overflow, where the maliciously supplied bytes (e.g., 'A' characters, 0x41) corrupted a critical pointer or data structure on the heap, leading to an invalid memory dereference and a crash.

Ellis further illustrated the real-world impact by describing how attempting to open the crafted image in the iOS Photos app would cause the app to crash. This could even lead to a persistent denial-of-service for the Photos app if the device kept trying to render the image. Similarly, opening the image in macOS's Preview app would also trigger the same crash, underscoring the shared codebase between iOS and macOS for Image IO.

While the PoC focused on demonstrating a crash, Ellis noted the potential for this bug to be leveraged for a zero-click exploit if a vector existed to render the image via a notification or similar background process. He has not pursued further exploitation of this specific bug, as it has since been patched. The proof of concept is available on his GitHub, and a more in-depth blog post detailing the reverse engineering and diffing process can be found on his website, zygotsec.com. This practical example serves as an excellent illustration of how a logical bug (integer overflow) can lead to a powerful memory corruption primitive (heap overflow), a common stepping stone in exploit development.

Defensive Implications

▶ Watch: Q&A: Speaker's favorite elegant exploit (Pegasus) (34:50)

Billy Ellis's talk, while focused on offense, carries significant defensive implications for users, developers, and security professionals operating within the Apple ecosystem. Understanding the attacker's perspective and the foundational security model is paramount for robust defense.

  1. Prioritize Software Updates: The entire premise of patch diffing hinges on Apple releasing security updates to fix vulnerabilities. Users should always update their iOS devices promptly to the latest versions (e.g., iOS 26.6, which Ellis noted had 87 CVEs). These updates contain critical patches that close exploit windows, making devices significantly more resilient to known attacks.
  2. Be Wary of Untrusted Media and Files: The Image IO example, and the broader discussion of media parsing bugs, highlights a critical attack vector. Zero-click vulnerabilities often originate from processing malicious media files received through messaging apps or browsers. Users should exercise caution with attachments or links from unknown sources.
  3. Strong Sandbox Enforcement is Key: Developers should design applications with Apple's sandbox model in mind, adhering to the principle of least privilege. Understanding which entitlements are truly necessary and how their app interacts with proxy processes and kernel drivers is vital. For security teams, monitoring and auditing sandbox profiles can help identify potential weak points or over-privileged applications.
  4. Mitigation Awareness and Design: Apple's continuous investment in hardware-backed mitigations like TXM, SPTM, KTRR, Pointer Authentication, and Memory Integrity Enforcement significantly raises the bar for attackers. Developers should be aware of how these mitigations affect their code and integrate secure coding practices that account for them. For instance, avoiding common memory corruption patterns that PA is designed to detect.
  5. Utilize Patch Diffing as a Defensive Tool: Security researchers and internal product security teams can proactively use patch diffing to quickly identify and understand newly patched vulnerabilities in Apple's updates. This allows them to:
  • Assess Risk: Determine if a patched vulnerability could have impacted their specific applications or infrastructure.
  • Improve Threat Modeling: Incorporate new vulnerability types and attack vectors into their threat models.
  • Enhance Detection: Develop signatures or behavioral analytics to detect exploitation attempts for newly disclosed bugs.
  • Learn from Apple's Fixes: Understand how Apple addresses security flaws, informing their own secure development lifecycle.
  1. Continuous Education and Re-implementation: Ellis stresses the importance of studying past research and re-implementing exploits. This hands-on approach is not just for offensive researchers; it equally benefits defenders by deepening their understanding of how vulnerabilities are chained and exploited in practice, enabling them to design more effective countermeasures.

Ultimately, Ellis's talk underscores that iOS security is a dynamic cat-and-mouse game. While Apple builds formidable defenses, attackers relentlessly seek the cracks. A proactive, informed, and continuously learning defensive posture is the most effective way to protect against the sophisticated threats targeting the platform.

Key Takeaways

  • Multi-layered Security: iOS relies on a robust, multi-layered security model centered on the Secure Boot Chain, Code Signing, and Sandboxing to protect against tampering and unauthorized code execution.
  • Exploit Chain Anatomy: Successful iOS exploitation typically involves chaining Remote Code Execution (RCE), Sandbox Escape, and Kernel Exploit (LPE) stages, each targeting specific vulnerabilities to bypass progressive security layers.
  • Modern Mitigation Challenges: Advanced hardware-backed mitigations like TXM, SPTM, KTRR, Pointer Authentication, and future Memory Integrity Enforcement significantly increase the complexity and difficulty of developing reliable exploits.
  • Practical Research Setup: Researchers can choose between physical checkra1n-enabled iPhones, virtualized iOS environments (e.g., Corellium, VPhone CLI), or ARM64 Macs, each offering unique trade-offs in debugging capabilities and environment fidelity.
  • Patch Diffing for Vulnerability Discovery: Patch diffing (comparing patched and unpatched binaries using tools like IDA Pro with bindiff) is an effective, hands-on method for beginners to identify and understand real-world security vulnerabilities, such as the Image IO integer overflow leading to a heap overflow.
  • Continuous Learning and Hands-on Practice: Deepening expertise in iOS security requires consistent study of past research, analysis of in-the-wild exploits, and, critically, re-implementing these concepts and vulnerabilities to gain practical experience.

About the Speaker(s)

Billy Ellis is a highly regarded Vulnerability Researcher, specializing in iOS Security and Reverse Engineering. With a decade of experience in iOS research, including six years professionally, his work primarily focuses on discovering vulnerabilities and developing exploits within the iOS kernel and for sandbox escape scenarios. Ellis is also known for his educational contributions through his YouTube channel, where he provides in-depth breakdowns of complex exploits and reverse engineering topics for a wider audience. His LinkedIn profile is available at https://www.linkedin.com/in/billy-ellis/.

Reviews

Dr. Zero (Offensive Security Researcher) — STRONG ACCEPT

This is exactly what a 101-level iOS security talk should be: structured, honest about complexity, and capped with a real patch-diff walkthrough that actually teaches the methodology. Ellis doesn't oversell, doesn't pad with vendor fluff, and delivers a practical on-ramp for researchers who want to start touching real bugs.

Heather Calloway (CISO) — SOLID

Solid introductory material for aspiring iOS security researchers — patch diffing walkthrough is hands-on and well-executed. Not a talk for security leadership; it's a training session for junior offensive researchers entering mobile security.

→ Top-rated talks at Objective for the We v4.0 (#OFTW) 2026

All talks from Objective for the We v4.0 (#OFTW) 2026