AI-Assisted Exploit Development: An XNU Case Study

Dion Blazakis (Calif Research)

[un]prompted.au 2026 · Day 2 · Main Hall

Overview

In this compelling talk from [un]prompted.au, Dion Blazakis of Calif Research presented a detailed case study on the development of an AI-assisted local privilege escalation (LPE) exploit for macOS, targeting the latest hardware and software versions. The presentation, titled "AI-Assisted Exploit Development: An XNU Case Study," delved into the intricacies of bypassing modern Apple security mitigations through a multi-stage exploit chain. Blazakis meticulously outlined how frontier AI models were leveraged not for full automation, but as a collaborative "pair-hacking" partner, significantly accelerating the research and discovery process for complex kernel vulnerabilities.

Watch on YouTube

Visual summary for AI-Assisted Exploit Development: An XNU Case Study by Dion Blazakis
Visual summary for AI-Assisted Exploit Development: An XNU Case Study by Dion Blazakis

Key moments

  1. 0:00 AI-assisted macOS exploit development goal
  2. 2:50 Exploits as primitive enrichment pipelines
  3. 8:50 Initial kernel vulnerabilities: Type confusion and heap leak
  4. 15:00 AI rig setup and testing environments
  5. 25:00 AI finds reliable arbitrary kernel read/write
  6. 28:00 Apple's credential mitigations block direct LPE
  7. 30:00 AI devises cross-process memory access
  8. 39:00 Takeaways: AI as pair hacker, rapid learning, theorem proving

AI-Assisted Exploit Development: An XNU Case Study

Speakers: Dion Blazakis, Principal Security Researcher, Calif Research

Conference: [un]prompted.au

YouTube: https://www.youtube.com/watch?v=fq-O0Rf6wjo

Overview

In this compelling talk from [un]prompted.au, Dion Blazakis of Calif Research presented a detailed case study on the development of an AI-assisted local privilege escalation (LPE) exploit for macOS, targeting the latest hardware and software versions. The presentation, titled "AI-Assisted Exploit Development: An XNU Case Study," delved into the intricacies of bypassing modern Apple security mitigations through a multi-stage exploit chain. Blazakis meticulously outlined how frontier AI models were leveraged not for full automation, but as a collaborative "pair-hacking" partner, significantly accelerating the research and discovery process for complex kernel vulnerabilities.

The core motivation behind this research was to challenge the prevailing skepticism regarding AI's utility in sophisticated exploit development. Blazakis's boss, Bruce, had initially tasked an AI agent named Mythos with chaining a set of reported kernel vulnerabilities on macOS, which proved unsuccessful. This led to a crucial question: was the AI agent insufficient, or was the target inherently too hard for AI to tackle? Blazakis's work provides a resounding answer, demonstrating that with human guidance and a well-configured environment, AI can rapidly uncover and implement novel techniques required to achieve LPE on a highly hardened system, even against mitigations like Apple's Memory Tagging Extension (MTE) and hypervisor-enforced read-only memory.

While acknowledging that more efficient routes to root exist on macOS for an unprivileged user, this research was framed as an academic exercise. Its primary goal was to explore the limits of AI-assisted exploit development against a challenging, modern target using memory corruption bugs. The insights gleaned from this process shed light on the evolving landscape of offensive security, highlighting the potential for AI to augment human capabilities in discovering and chaining complex primitives, ultimately paving the way for more potent and rapidly developed exploits.

Background

▶ Watch: AI-assisted macOS exploit development goal (0:00)

Exploit development, particularly for modern systems laden with sophisticated mitigations, has evolved into a complex "primitive enrichment pipeline," as articulated by Blazakis. Unlike the simpler exploits of yesteryear, where a single vulnerability might directly grant control, contemporary exploit chains involve navigating an intricate "attacker capabilities graph." Each step in this graph builds upon previously established primitives, iteratively increasing attacker control until the ultimate objective is reached. This conceptual framework, where the structure of the graph is often unknown upfront and must be discovered ad hoc, forms the foundation of Blazakis's approach.

Blazakis drew parallels to historical exploit development, recalling a Pwn2Own exploit he wrote for iPhone 15 years prior, which he now describes as "laughably simple" due to the absence of fundamental mitigations like ASLR (Address Space Layout Randomization) for images. His previous experience with XNU kernel exploitation dated back to 2010, highlighting his user-space background and initial "naive" view of the modern kernel landscape. This personal context underscores the value of AI in rapidly re-skilling and adapting to new mitigation strategies.

The inspiration for this AI-assisted methodology was partly drawn from Sean Heelan's QuickJS experiments, which explored the "industrialization of exploit engineering." Heelan's work demonstrated how AI agents could identify "waypoints" – crucial primitives – and then find ways to connect these dots, effectively mapping out elevations of attacker control. Blazakis extended this concept, suggesting that the process resembles early AI research into "blackboard systems," where independent agents contribute pieces to an unstructured problem, collectively building a solution graph without a predefined path. This analogy frames exploit development as a form of "theorem proving," where the human "prover" guides the AI's search through a vast space of possibilities.

Key Findings

▶ Watch: Initial kernel vulnerabilities: Type confusion and heap leak (8:50)

The central finding of this research is the undeniable acceleration and enhancement of complex exploit development when frontier AI models are integrated as a collaborative tool. Blazakis demonstrated that AI, when properly guided, can navigate the intricate landscape of modern security mitigations and discover novel techniques that might otherwise take human researchers significantly longer, or even be missed entirely.

Key findings include:

  • Significant Speedup: The entire exploit chain, targeting the latest macOS on modern hardware, was developed in just five days, despite Blazakis's decade-long hiatus from XNU kernel exploitation. This dramatic reduction in development time highlights AI's ability to rapidly bridge knowledge gaps and accelerate the discovery phase.
  • Novel Primitive Discovery: The AI successfully devised a sophisticated cross-process read/write primitive by identifying an unprotected VM map pointer within the thread structure. This technique, involving parking threads in the kernel and swapping VM maps, is a testament to AI's capacity for creative problem-solving in a highly constrained environment.
  • Effective Mitigation Bypass: The AI-assisted approach successfully circumvented several robust Apple mitigations, including MTE for heap allocations, KASLR (Kernel Address Space Layout Randomization), and hypervisor-enforced read-only memory protecting process credentials and kernel structures.
  • "Pair Hacking" as a Potent Methodology: Blazakis emphasized the power of treating the AI model as a "pair-hacking" partner. Through iterative prompting, providing ideas, and guiding its search, the AI acted as an extension of his own research, validating hypotheses and generating code snippets for experimentation. This collaborative model proved more effective than attempting full automation.
  • LLMs for Rapid Learning and Experimentation: The experience underscored the value of Large Language Models (LLMs) as powerful learning accelerators. Beyond generating summaries, they can quickly construct and run experiments, allowing researchers to test their understanding of complex kernel internals and validate exploit primitives.
  • Exploit Development as Theorem Proving: Blazakis reinforced his analogy of exploit development to theorem proving, where AI assists in exploring the "proof space" for a complex vulnerability chain. This framework encourages flexible primitive construction and combination, rather than rigid, predefined steps.

Technical Deep Dive

▶ Watch: AI finds reliable arbitrary kernel read/write (25:00)

The exploit chain began with two critical kernel vulnerabilities provided by Blazakis's boss, Bruce, both residing in open-source kernel extensions for network file systems, accessible to an unprivileged macOS user.

The Initial Vulnerabilities:

  1. SMB Client Type Confusion:
  • Location: SMB client kernel extension.
  • Nature: A classic type confusion bug where a pointer to one structure is incorrectly treated as a pointer to another.
  • Trigger: An unprivileged user mounts their own SambaFS server and interacts with it. The kernel caches request information, associates it with a request ID, and sends it to the server. Upon receiving a response, the kernel casts the stored context back based on the request. Crucially, it failed to validate that the request ID matched the response ID.
  • Primitive: By manipulating request and response IDs, an attacker could cast a controlled file ID directly into a pointer. This yielded a "messy write primitive," allowing the attacker to set two controlled fields at an offset from a supplied Kernel Virtual Address (KVA), albeit with potential side effects of clobbering zeros elsewhere.
  • Significance: Blazakis noted this bug's particular value because of Apple's MTE (Memory Tagging Extension) on ARM. MTE assigns different "colors" to adjacent heap allocations, deterministically catching linear heap overflows. A type confusion, however, can bypass MTE by directly manipulating pointers rather than relying on linear overflows. The initial challenge was the need for a known KVA to make this primitive useful.
  1. WebDAV Uninitialized Heap Buffer Leak:
  • Location: WebDAV kernel extension.
  • Nature: A "stupendously simple" information leak vulnerability.
  • Trigger: An unprivileged user makes a request to read a file from a WebDAV file system. If the server returns insufficient information, the kernel fails to initialize a heap buffer allocated via kalloc_large.
  • Primitive: This allowed for the leakage of heap residue from large allocations, providing a reliable way to obtain kernel pointers.
  • Significance: This bug was crucial for overcoming the KVA requirement of the type confusion vulnerability, providing the necessary kernel addresses.

The Exploit Development "Rig":

Blazakis meticulously set up an environment for AI-assisted research:

  • Firmware & Skills: ipsw for pulling firmware, ipsw-skill (Blacktop's tools) for teaching the model about specific functions.
  • Analysis: IDA Pro with ida-mcp-rs (another Blacktop tool).
  • Execution Environments:
  • Virtualized: Using Apple's Virtualization Framework, configured with lldb kernel debugging. This allowed the AI to run experiments and observe kernel state. However, it lacked hardware-specific mitigations.
  • Physical Hardware: An M5 MacBook Air on a dedicated network with passwordless sudo. This was the ultimate target for real-world validation.
  • Source Code Access: The AI was given access to the XNU kernel source code and the open-source kernel extensions.
  • Operational Considerations: Blazakis highlighted the importance of clearing NVRAM between runs on physical hardware to prevent iBoot from entering restore mode due to repeated kernel panics.

AI-Assisted KASLR and Heap Leakage:

The first step was to leak KASLR (Kernel Address Space Layout Randomization). The AI quickly found a method using the WebDAV leak:

  1. Heap Spray: The attacker process would spray the kalloc_large heap with Mach messages and out-of-line Mach ports.
  2. Leak Live Pointers: The WebDAV leak primitive was then used to leak residue, which included live pointers to these sprayed port objects.

Initially, the AI attempted to use the SMB type confusion to race and corrupt a text segment function pointer within a port object, then leak it back. This worked in the VM but failed on the M5. The reason: the target corruption extended beyond the MTE-tagged port object, hitting an adjacent, differently tagged object, leading to a deterministic MTE trap. Blazakis had to guide the AI to find a new target, which it did, demonstrating the primitive's robustness in leaking various heap objects.

Achieving Arbitrary Kernel Read/Write:

The next objective was to establish a "clean" arbitrary kernel read and write, free from the messy side effects of the initial type confusion. The AI's initial attempts, left to its own devices, resulted in "Kool-Aid Man" style corruption, blasting over critical global data (e.g., sysctl strings, pthreads), which worked in the VM but was unstable and unreliable on real hardware.

This is where Blazakis's "pair-hacking" approach proved invaluable. He guided the AI, asking it to list user-space-to-kernel interaction points (e.g., sysctl, ioctl, sockopt) that could be leveraged if a heap object were corrupted. The AI identified the ICMPv6 socket filter and, specifically, the inpcb (Internet Protocol Control Block) object.

By corrupting a pointer within the inpcb object using the messy write primitive, and then leveraging standard socket options from user space, the exploit achieved a reliable arbitrary kernel read/write. This technique was later found to be similar to methods used by the Coruna and DarkSword exploit kits for their own reliable primitives. A significant byproduct of this achievement was that the exploit no longer needed to leak the kernel slide early on, as it could directly read kernel text addresses from the inpcb objects themselves.

Bypassing Hypervisor-Enforced Credential Protection:

With arbitrary kernel read/write, the traditional POSIX LPE approach would involve stealing and overwriting process credentials (e.g., pointing to launchd's credentials). However, Apple implements strong mitigations:

  • Read-Only Memory: Process and thread structures, including credentials, are stored in hypervisor-enforced read-only memory. Direct writes are prevented.
  • Consistency Checks: Kernel getters for credentials validate consistency, preventing indirect pointer manipulation (e.g., pointing a read-only pointer to launchd's credentials).

The AI initially failed to bypass this directly. Blazakis then provided a new direction: instead of direct credential overwrite, "pivot back into user space" and perform a data-only attack on launchd (PID 1), which runs as root. The challenge was to reliably modify user-space memory from the kernel, a complex task due to Apple's protections for VM maps and SPTM (Secure Page Table Management).

Novel Cross-Process Read/Write (User Space):

The AI, guided by Blazakis's idea, devised an ingenious cross-process read/write technique:

  • Key Insight: The VM map for a thread, stored within the thread structure, is not protected by hypervisor-enforced read-only memory.
  • Mechanism (for read):
  1. Worker Thread Parking: An attacker process uses two threads. A "worker" thread enters the kernel and is parked (blocked) by filling a pipe with data, then attempting another write to the full pipe using the target user-space address (e.g., in launchd).
  2. VM Map Swap: While the worker is blocked in the kernel, the "main" thread uses the kernel arbitrary write to overwrite the worker thread's VM map pointer, redirecting it to launchd's VM map.
  3. Trigger Copy: The main thread then reads from the pipe, which wakes the worker thread.
  4. Data Copy: The worker thread resumes, calling copyin from the target address in launchd (now mapped into its context) into the pipe.
  5. Re-Park & Restore: The copyin operation eventually fills the pipe, re-parking the worker. The main thread then restores the worker's original VM map.
  6. Fault Handling: The worker thread resumes and likely faults, but a specific bit can be set in the thread to gracefully handle copyin faults without crashing the process.
  7. Data Retrieval: The main thread finally reads the desired data from the pipe.
  • User Space MTE Bypass: The AI also discovered that a specific bit could be twiddled in the process structure to disable user-space MTE for that process, simplifying memory scanning in launchd.
  • Write Primitive: A similar technique using Unix sockets instead of pipes was developed for cross-process writes.

Final LPE and Root Shell:

With reliable cross-process read/write, the AI was then able to:

  • Discover a constrained function calling primitive in the kernel.
  • Modify the saved state of a target thread to invoke the kernel's legitimate setuid functions, which are designed to bypass the hypervisor-enforced read-only memory.
  • This ultimately led to the successful acquisition of a root shell.

Blazakis noted that these final bypasses, when reported to Apple, were deemed "working as intended," implying they represent architectural complexities rather than simple vulnerabilities.

Demo / Proof of Concept

▶ Watch: Apple's credential mitigations block direct LPE (28:00)

While Dion Blazakis did not perform a live demonstration during the talk itself, he acknowledged that a typical LPE exploit, which simply results in a root shell, is not visually "exciting." He mentioned that a public demo of the exploit chain is available on YouTube via Calif Research's blog post, where it was integrated with "IOSurface" to produce more visually engaging effects, like "making fire happen." The core proof of concept, however, was the successful and reliable acquisition of a root shell on the latest macOS running on M5 hardware, validating the AI-assisted exploit chain.

Defensive Implications

▶ Watch: Takeaways: AI as pair hacker, rapid learning, theorem proving (39:00)

This research carries significant implications for defenders, particularly those tasked with securing modern, hardened operating systems like macOS:

  • Anticipate AI-Accelerated Attacks: The ability of AI to rapidly develop complex exploit chains means that the time window between vulnerability discovery and weaponization could shrink considerably. Defenders need to assume that sophisticated attackers will increasingly leverage AI for faster primitive discovery, chain building, and mitigation bypasses.
  • Robustness of Mitigations vs. Novelty: While Apple's mitigations like MTE, KASLR, and hypervisor-enforced read-only memory are powerful, this research demonstrates that even these can be circumvented by sufficiently novel techniques, especially when aided by AI's exploratory capabilities. Defenders should not solely rely on individual mitigation layers but consider their combined resilience against creative attack paths.
  • Focus on Kernel Data Structure Integrity: The discovery of the unprotected VM map pointer within the thread structure highlights the critical importance of scrutinizing every kernel data structure for potential weak points. Even seemingly minor omissions can be leveraged by AI to construct powerful primitives like the cross-process read/write.
  • Patching vs. Architectural Resilience: The initial vulnerabilities (type confusion, uninitialized heap buffer) were patched by Apple (in macOS .6 something, though specific CVEs were not provided). However, the later stages of the exploit, particularly the cross-process read/write and the setuid primitive, were deemed "working as intended." This suggests that some bypasses might be considered inherent architectural behaviors or extremely difficult to address without fundamental system redesigns. Defenders must understand that patching individual bugs is a continuous race, but architectural resilience against AI-driven exploration is a more profound challenge.
  • Complexity of Defense: The multi-stage, inter-process, and kernel-level nature of this exploit underscores the escalating complexity of defending modern systems. Effective defense requires a deep understanding of hardware-level mitigations, kernel internals, and the interplay between different system components, mirroring the comprehensive approach taken by the AI in constructing the exploit.
  • Proactive Threat Modeling with AI in Mind: Security teams should incorporate AI-assisted attack scenarios into their threat modeling. This includes considering how an AI might combine seemingly innocuous bugs, leverage subtle architectural nuances, or discover unexpected interactions between system components to achieve its objectives.

Key Takeaways

  • AI significantly accelerates complex exploit development: Frontier AI models can drastically reduce the time and effort required to build multi-stage exploit chains against hardened targets, even for researchers re-entering a domain after a long hiatus.
  • "Pair hacking" with AI is a powerful methodology: Treating AI as a collaborative partner, providing guidance, ideas, and iterative feedback, is more effective than attempting full automation for intricate exploit development tasks.
  • Exploit development mirrors theorem proving: Viewing exploit development as discovering a path through an "attacker capabilities graph" allows AI to explore vast solution spaces and combine primitives in novel, unexpected ways.
  • LLMs enhance rapid learning and experimentation: Large Language Models are excellent tools for quickly understanding complex system internals, generating experimental code, and validating hypotheses in security research.
  • Novel techniques can bypass strong mitigations: Even robust mitigations like Apple's MTE and hypervisor-enforced read-only memory can be circumvented through creative, AI-assisted primitives, such as the cross-process VM map swapping technique.
  • Continuous vigilance is required against evolving attack surfaces: While initial vulnerabilities are patched, the underlying architectural complexities and the ability of AI to discover novel bypasses mean that defenders must constantly re-evaluate the resilience of their systems against sophisticated, AI-driven offensive capabilities.

About the Speaker(s)

Dion Blazakis is a Principal Security Researcher at Calif Research. With a background primarily in user-space security, Blazakis embarked on this project after a decade-long break from XNU kernel exploit development, his last XNU exploit dating back to 2010. He previously worked at Apple, focusing on user-space security challenges. Blazakis credits Mark (the conference host) as one of his idols in the security community and expresses gratitude to his colleagues Bruce, Josh, and Thai for their support in his research and attendance at the [un]prompted.au conference.

Reviews

Dr. Zero (Offensive Security Researcher) — MUST SEE

This is what AI security research should actually look like. Blazakis strips away the autonomous-agent marketing garbage and shows how an expert uses LLMs to accelerate XNU kernel exploitation. The cross-process VM map swap primitive to bypass Apple's hypervisor protections makes this a mandatory watch.

Heather Calloway (CISO) — SOLID

This is a deep-technical exploit talk, but the strategic implication is unavoidable. By using an LLM as a pair-hacker, a researcher built a multi-stage exploit bypassing modern macOS kernel mitigations in just five days. It proves that the time-to-weaponization for complex vulnerabilities is collapsing, which fundamentally alters our endpoint risk models.

→ Top-rated talks at [un]prompted.au 2026

All talks from [un]prompted.au 2026