Back to Blog
Adversarial Machine Learning

Exploiting iOS WebKit: A Look into Modern Mobile Browser Vulnerabilities

OffSec Research Team
10 June 2026 • 09:00 AM19 min
Exploiting iOS WebKit: A Look into Modern Mobile Browser Vulnerabilities
TL;DR — On iOS, every browser is Safari under the hood: Apple's App Store rules force Chrome, Firefox, and all others to use WebKit. That makes WebKit the single most valuable remote attack surface on hundreds of millions of devices, and the entry point for nearly every iOS "zero-click" and "one-click" exploit chain. This article explains why WebKit is the universal iOS browser engine, the dominant bug classes (JavaScriptCore type confusion and the addrof/fakeobj primitives, DOM use-after-free), how an in-renderer exploit chains through Apple's sandbox and PAC/PPL mitigations to kernel and persistence, and the defences — from JITCage and Lockdown Mode to BlastDoor.

Executive Summary

A web-rendering engine is a uniquely hostile attack surface: it parses untrusted HTML, CSS, and — most dangerously — executes untrusted JavaScript at high speed via a JIT compiler, all on content an attacker fully controls just by getting a victim to open a link. On iOS, this surface is concentrated: Apple's longstanding App Store policy required that all browsers and any app showing web content use the system WebKit engine (and its JavaScriptCore JIT). So a WebKit vulnerability is not "a Safari bug" — it is a bug in the rendering engine behind Chrome on iOS, Firefox on iOS, in-app web views, iMessage link previews, and Mail. One WebKit RCE is a foothold on essentially every iPhone.

This is why WebKit is the perennial first stage of high-end iOS exploit chains, from jailbreaks to commercial spyware (the Pegasus/NSO and Predator/Cytrox ecosystems). The chain almost always starts the same way: a memory-corruption bug in WebKit gives the attacker code execution inside the renderer (WebContent) process. But the renderer is sandboxed — so the chain must continue, escaping the sandbox and exploiting the kernel to gain the system-wide control that spyware needs. Understanding iOS WebKit exploitation means understanding both the in-renderer primitive and the long climb out of the sandbox.

Why WebKit Is the Universal iOS Engine

diagram — rendering…
flowchart TD
    A["Any iOS browser / web view"] --> B["MUST use WebKit (App Store policy)"]
    B --> C["Safari"]
    B --> D["Chrome on iOS<br/>(WebKit wrapper)"]
    B --> E["Firefox on iOS<br/>(WebKit wrapper)"]
    B --> F["In-app WKWebView<br/>(banking, social apps)"]
    B --> G["iMessage / Mail<br/>link previews"]
    C & D & E & F & G --> H["One WebKit bug → all of them"]
    style H fill:#2a0c14,stroke:#ef233c,color:#fee2e2

Until very recent regulatory changes (the EU's Digital Markets Act began forcing Apple to allow alternative engines in 2024, narrowly), there was effectively no engine diversity on iOS. "Chrome on iOS" is Chrome's UI wrapped around WebKit; it does not ship Blink/V8. This monoculture means:

  • The attack surface is identical across browsers — there's no "use a different browser to be safe."
  • A single WebKit 0-day has the broadest possible reach.
  • Web content reaches users through many vectors beyond the browser (messages, mail, embedded web views), multiplying delivery options for the same bug.

That concentration is precisely why WebKit commands the highest bug-bounty and grey-market prices and why nation-state and commercial spyware chains invest so heavily in it.

Bug Class 1 — JavaScriptCore Type Confusion

The most productive WebKit bug class is type confusion in JavaScriptCore (JSC), the JavaScript engine. JS engines must run untrusted code blazingly fast, so they use JIT compilation and aggressive speculative optimisation: the JIT assumes an object has a certain "shape"/type and emits fast machine code based on that assumption, guarded by lightweight checks. When the engine's reasoning about types is subtly wrong — often in the optimising compiler's analysis or in how a callback can mutate an object mid-operation — the attacker tricks the engine into operating on an object of one type as if it were another.

javascript
// Conceptual JSC type-confusion shape:// 1. Get the JIT to specialize for an object of type A.// 2. Use a side effect (a getter, a Proxy, array species hook) to swap//    the object's type to B WITHOUT the JIT re-checking.// 3. The JIT's fast path now treats B's memory layout as A's →//    out-of-bounds / mistyped read & write.let trick = { valueOf() { /* mutate the array's type here */ return 0; } };fastpath(victimArray, trick);   // engine acts on stale type assumption

Type confusion in a JS engine is so dangerous because it converts directly into the two primitives that make memory fully controllable.

The Crown Jewels: addrof and fakeobj

Modern JSC exploitation revolves around constructing two primitives from a memory bug:

text
addrof(obj)  →  leak the ADDRESS of a JS object   (defeats ASLR within the heap)fakeobj(addr)→  create a fake JS object at an ATTACKER-CHOSEN address
diagram — rendering…
flowchart LR
    A["Type confusion /<br/>OOB on a JS array"] --> B["addrof: read an object<br/>pointer out as a 'double'"]
    A --> C["fakeobj: write a controlled<br/>pointer where an object is expected"]
    B & C --> D["Arbitrary READ/WRITE<br/>in the renderer's address space"]
    D --> E["Build a fake TypedArray/<br/>JSObject → full R/W"]
    style E fill:#2a0c14,stroke:#ef233c,color:#fee2e2

The classic technique abuses the fact that JS arrays can hold either doubles (raw 64-bit values) or object pointers, distinguished by the array's type tag. With a type confusion that lets you read an object-typed slot as a double, you addrof (leak the pointer). With one that lets you write a double into an object-typed slot, you fakeobj (forge a pointer). From these you craft a fake `TypedArray` whose backing-store pointer you control, giving arbitrary read/write across the renderer's entire address space. At that point the attacker effectively owns the WebContent process's memory — they can read code addresses, overwrite function pointers, and stage the next step. Defeating control-flow integrity (see PAC below) is what stands between R/W and code execution.

Bug Class 2 — DOM Use-After-Free

The other staple is use-after-free in the DOM/rendering code (C++). The DOM is a vast graph of reference-counted objects with intricate lifetime rules; a callback that runs during a DOM operation can free an object the engine still holds a pointer to. Reclaiming that freed slot with attacker-controlled data (via heap grooming — see the companion heap-spraying article) turns the dangling pointer into a controlled vtable call or a read/write primitive. WebKit's heap (bmalloc/IsoHeaps) is hardened against cross-type reclamation, so modern UAF exploitation requires precise same-size, same-type grooming. CSS, SVG, and animation code have all been fertile UAF territory because of their complex object lifetimes and event-driven callbacks.

The Climb: From Renderer to Kernel

In-renderer code execution is only the first stage. The WebContent process runs in a tight sandbox (Apple's Seatbelt/sandbox profiles), so the attacker can't yet read your messages or install spyware. The full chain must escape:

diagram — rendering…
flowchart TD
    A["1. WebKit memory bug"] --> B["2. addrof/fakeobj → arbitrary R/W in renderer"]
    B --> C["3. Defeat PAC (pointer auth) → code exec in WebContent"]
    C --> D["4. Sandbox escape:<br/>bug in an IPC service / kernel driver<br/>reachable from the sandbox"]
    D --> E["5. Kernel exploit → defeat KTRR/PPL/PAC"]
    E --> F["6. Persistence / spyware install"]
    style A fill:#2a0c14,stroke:#ef233c,color:#fee2e2
    style F fill:#2a0c14,stroke:#ef233c,color:#fee2e2

Each stage faces a dedicated mitigation that the attacker must individually defeat:

  • PAC (Pointer Authentication, ARMv8.3). Apple Silicon cryptographically signs pointers (return addresses, function pointers, vtable pointers) so a forged pointer fails authentication. After getting arbitrary R/W, the attacker can read/manipulate memory but converting that to control-flow hijack requires a PAC bypass — a major reason modern chains stay "data-only" as long as possible or hunt for signing-gadget weaknesses.
  • The sandbox. Renderer code can only reach a limited set of IPC endpoints. The escape stage exploits a bug in a more-privileged service (e.g. a system daemon) or a kernel driver reachable through the sandbox's allowed syscalls/Mach messages.
  • Kernel hardening: KTRR, PPL, KASLR. Even in the kernel, KTRR locks kernel text read-only, PPL (Page Protection Layer) protects critical page tables and code-signing structures so that even kernel R/W can't trivially patch code or disable signing, and KASLR randomises kernel base. Defeating PPL is often the hardest, most prized step — it's what separates "kernel read/write" from "persistent, signing-disabled implant."

This layered ascent is why a complete iOS exploit chain typically combines multiple 0-days (a WebKit bug + a sandbox-escape bug + a kernel bug + sometimes a PAC/PPL bypass), and why such chains are so expensive and so closely associated with well-resourced actors.

Delivery Vectors and Zero-Click

WebKit's reach beyond the browser enables the most dangerous delivery class: zero-click. Because iMessage and Mail render web/rich content automatically (link previews, attachments), a chain that triggers on parsing rather than user interaction needs no tap. The infamous FORCEDENTRY chain reached through iMessage attachment parsing; other Pegasus/Predator deliveries used a malicious link (one-click) opened in any WebKit context. Apple's BlastDoor service was introduced precisely to sandbox and harden iMessage parsing, and Lockdown Mode disables much of the risky web/message functionality (JIT, certain attachment/link previews, complex web features) for high-risk users — both are direct responses to WebKit-and-messaging zero-click chains.

Defence: Apple's WebKit Hardening Stack

text
MITIGATION            WHAT IT BREAKSJITCage / hardened    Restricts what the JIT can emit & where; limits  JIT (APRR/JIT W^X)    turning arbitrary R/W into code executionPAC (pointer auth)    Forged control-flow pointers fail authenticationIsoHeaps / bmalloc    Type-segregated heap → blocks UAF cross-type reclaimGigacage              Bounds JS array/typed-array backing stores into a                        guarded region → blunts OOB → arbitrary R/WStructure ID hardening  Randomises/validates JSC object "shape" IDsPPL / KTRR / KASLR    Protect kernel code & page tables from kernel R/WBlastDoor             Sandboxes iMessage parsing (zero-click hardening)Lockdown Mode         Disables JIT + risky web/message features for targetsRapid Security Resp.  Fast out-of-band WebKit patch delivery

For practitioners and defenders, the actionable guidance:

  • Patch immediately. Apple's Rapid Security Responses exist because WebKit 0-days are exploited in the wild now. Keep iOS current; WebKit fixes are among the most time-critical updates there are.
  • Enable Lockdown Mode for high-risk users (journalists, activists, executives, officials). It disables JIT and trims the WebKit/messaging attack surface that nearly every commercial-spyware chain depends on — a dramatic, if usability-costly, reduction.
  • Treat any WebKit context as full attack surface. In-app WKWebView is the same engine; don't load untrusted content in embedded web views, and apply the same patch discipline.
  • Defence in depth in the platform. Apple's own controls — Gigacage, IsoHeaps, PAC, PPL, JIT hardening, BlastDoor — are what raise a single bug into needing a full multi-0-day chain. The lesson for builders of any browser/engine: segregate heaps by type, bound JIT'd buffers, harden the JIT's output, and protect control-flow integrity, because each layer multiplies attacker cost.
  • For researchers: the productive path remains JSC type confusion → addrof/fakeobj → fake TypedArray → arbitrary R/W, then the PAC/sandbox/kernel climb; study how each mitigation reshapes that path rather than eliminating it.

PAC Bypass Techniques in WebKit Exploits

Pointer Authentication Codes (PAC) were introduced on Apple Silicon (ARMv8.3) and backported to A12+ chips. Every return address and most function pointer values are signed with a cryptographic MAC (using the secret key stored in system registers) before storage and authenticated before use. A forged or corrupted pointer fails autia/autib and triggers an illegal-instruction fault, not a control-flow hijack.

After achieving arbitrary read/write via addrof/fakeobj, the attacker has full memory visibility but cannot immediately redirect control flow — every interesting pointer they would overwrite is PAC-protected. Modern iOS exploit chains use several techniques to work around this.

pac_auth Gadgets

The key insight is that PAC signs and authenticates with context. A signed function pointer for context A cannot be used for context B. But if an attacker can find a gadget that reads a signed pointer from attacker-controlled memory and branches to it using the context already embedded in the pointer, they can "reuse" a legitimate signed pointer in a new location. These are called pac_auth gadgets — sequences like ldr x16, [x0]; autia x16, x17; br x16 where the register set-up can be controlled.

arm
// Example pac_auth gadget in a WebKit binary:// x0 = attacker-controlled pointer to signed value// x17 = attacker-controlled context discriminatorldr  x16, [x0]        // load attacker's signed pointerautia x16, x17        // authenticate it — PAC is embedded in the pointer itselfbr   x16              // branch to authenticated pointer// Attacker supplies a LEGITIMATE signed pointer (read via arb-read from// another object) and re-uses it with a controlled discriminator.

Practical PAC bypass via gadget reuse requires leaking a legitimately-signed pointer (via arbitrary read) and constructing a gadget chain that lets that pointer reach the desired call site. This is significantly harder than classic ROP but achievable.

JIT Region PAC Bypass

WebKit's JIT compiler writes native code into a dedicated memory region. On iOS, the JIT region uses APRR/JIT permissions — a hardware permission mechanism that allows the JIT to write machine code but prevents arbitrary code from treating that region as writable (W^X at hardware level). Crucially, JIT-compiled code typically has weaker PAC guarantees than system code because the JIT must dynamically generate signed pointers at runtime.

Attackers target the JIT region by influencing the JIT to emit spray gadgets: by crafting specific JavaScript that, when JIT-compiled, produces a machine-code sequence containing useful gadgets at predictable offsets within the JIT sled. Because JIT code is signed differently from system pointers, a JIT-compiled return site may not carry a context-specific discriminator, allowing reuse. The attacker then pivots through the JIT region to reach a syscall wrapper or a gadget that executes with elevated context.

Use-After-Free to Forge PAC

A subtler technique applies when the attacker finds a UAF on a PAC-signed structure. After freeing a signed object and reclaiming that memory with attacker-controlled bytes, the attacker can write what looks like a signed pointer (by copying a legitimate signature observed from another object of the same type via arbitrary read) into the reclaimed slot. Since the sign context for objects of the same type and at the same vtable offset is typically identical, the forged entry passes authentication.

javascript
// Conceptual: leak a signed vtable pointer from object A,// use UAF to write that same signed pointer into freed object B's vtable slot,// then trigger a virtual call on B.let signed_ptr = addrof_vtable_entry(legitObject, 3);  // arb-readtrigger_uaf(victimObject);   // free victimObjectheap_groom(signed_ptr);      // reclaim with our signed pointervictimObject.doSomething();  // vtable dispatch → our address, PAC passes

JIT Spraying with WebAssembly

Classic JIT spraying in JavaScript has been largely mitigated by JITCage (which restricts what addresses the JIT can target) and code randomisation. WebAssembly (WASM) JIT spraying emerged as a more reliable modern alternative because WASM bytecode compiles to more predictable machine code with less JSC-specific transformation.

WASM Module Compilation for Gadget Planting

WASM modules are declared with explicit typed functions that the JIT compiles to near-direct machine code translations. By crafting a WASM module where function bodies contain specific sequences of numeric operations, the attacker can cause the JIT to emit chosen byte sequences at predictable offsets in the JIT region.

javascript
// Plant ROP-like gadgets via WASM constant operations// The WASM binary below, when JIT-compiled by JavaScriptCore,// emits native code containing target byte sequences.const wasm_bytes = new Uint8Array([  0x00, 0x61, 0x73, 0x6d, // magic: \0asm  0x01, 0x00, 0x00, 0x00, // version: 1  // ... type section, function section ...  // Function body: i32.const 0x90909090  → emits 0x90 0x90 0x90 0x90 (NOP sled)  // Function body: i32.const <gadget>    → emits specific byte pattern  // Repeat with slightly different constants to spray the JIT region]); const mod = new WebAssembly.Module(wasm_bytes);const inst = new WebAssembly.Instance(mod);// JIT region now contains attacker's byte spray at calculable offsets.// Call inst.exports.fn() to trigger compilation, then use arb-read// to locate the JIT page and compute gadget addresses.

The advantage of WASM over JavaScript for spraying is that WASM compiles to more predictable output (fewer speculative optimisation tiers), the JIT region offset for a given WASM function is more stable across executions, and WASM compilation happens eagerly on WebAssembly.Module() rather than waiting for a hot loop.

Sandbox Escape from the WebKit Renderer

In-renderer code execution lands the attacker inside the com.apple.WebKit.WebContent process, which runs under a strict Seatbelt sandbox profile. The profile whitelists only the IPC endpoints (Mach services, XPC connections) that the renderer legitimately needs to display content. Sandbox escape requires finding a vulnerability in a service reachable from within that whitelist.

WebKit Sandbox Profile

The WebKit sandbox is defined in WebContent.sb (or the compiled binary form shipped in the OS). It explicitly denies mach-lookup for most system services, blocks file-read* for nearly the entire filesystem, and restricts network access to Mach-port IPC. The allowed surface is narrow: communication with the UIProcess, a handful of font/media services, and the GPU process.

shell
;; excerpt of restrictions in WebContent sandbox profile (illustrative)(deny default)(allow mach-lookup (global-name "com.apple.WebKit.WebContent.Sandbox"))(allow mach-lookup (global-name "com.apple.fonts"))(deny mach-lookup (global-name-regex #"com\.apple\.security"))(deny file-read* (subpath "/private/var/mobile"))

IOKit Userclients as the Escape Vector

The most historically productive sandbox-escape surface has been IOKit userclient interfaces. IOKit drivers expose userspace APIs via userclient objects, and a non-trivial set of these are reachable from the WebKit sandbox because media, GPU, and sensor functionality requires kernel driver communication.

An IOKit userclient vulnerability typically takes one of two forms:

  • Type confusion in the userclient dispatch table: the driver's externalMethod handler performs insufficient validation of the type or structureInputSize fields, allowing out-of-bounds access into internal kernel structures.
  • Race condition in async userclient callbacks: a use-after-free triggered by racing clientClose with a pending async notification.

Both lead to kernel R/W, which combined with a KTRR/PPL bypass (the next stage) yields the ability to patch kernel memory or credential structures, escalating beyond the sandbox.

c
// Example: triggering a vulnerable IOKit method from WebContent sandbox// (using IOKit.framework, which is reachable from the sandbox)#include <IOKit/IOKitLib.h> io_connect_t conn;io_service_t svc = IOServiceGetMatchingService(kIOMasterPortDefault,    IOServiceMatching("VulnerableGPUDriver"));IOServiceOpen(svc, mach_task_self(), 0, &conn); // Method 42 has a type confusion: structureInputSize is not validateduint64_t input[8]  = { /* crafted to corrupt kernel heap */ };uint64_t output[4] = {0};IOConnectCallMethod(conn, 42, NULL, 0, input, sizeof(input),                    NULL, NULL, output, NULL);// → kernel R/W via corrupted kernel object

WebKit Exploit Mitigations Timeline

iOS VersionKey Mitigation AddedImpact on Exploit Chains
iOS 14 / A14 (2020)PAC (Pointer Authentication) broadly deployed on A12+Arbitrary write no longer directly yields code execution; PAC bypass required, significantly raising chain cost
iOS 14JITCage / APRR — hardware W^X on JIT pagesTraditional JIT spraying into writable pages eliminated; WASM-based approaches required
iOS 14.5BlastDoor sandboxed iMessage parsing serviceZero-click via iMessage attachment parsing isolated; FORCEDENTRY-style chains must escape BlastDoor first
iOS 15BlastDoor hardening — additional parsers isolated, faster restart on crashRepeat delivery of crashing payloads (crash-loop exploitation) made harder
iOS 16Lockdown Mode (opt-in) — disables JIT, many web features, message link previewsJIT spraying, many WebKit bug classes, and zero-click messaging vectors all disabled for enrolled users
iOS 16.2Rapid Security Response — out-of-band WebKit patch deliveryReduces time-to-patch for actively exploited WebKit 0-days from weeks to days
iOS 17Memory-safe language adoption in WebKit — Swift rewrites of parser componentsReduces UAF/OOB surface in DOM parsing code rewritten in memory-safe language

MITRE ATT&CK Mapping

ATT&CK TechniqueIDRelevance to iOS WebKit Exploitation
Exploit Public-Facing Application / BrowserT1203WebKit memory corruption triggered via malicious web content in Safari or any WKWebView
Drive-by CompromiseT1189One-click delivery: victim taps a malicious link, WebKit processes attacker-controlled content
Phishing: Spearphishing LinkT1566.002Link delivered via iMessage, email, or social media to lure victim to attacker page
Exploit for Client ExecutionT1203JSC type confusion or DOM UAF exploited to achieve code execution in renderer
Sandbox Evasion / EscapeT1055 (adapted)IOKit userclient or XPC service vulnerability used to escape WebContent sandbox
Defense Evasion: Exploitation of Remote ServicesT1211PAC bypass and FSOP/JIT-spray techniques used to defeat iOS exploit mitigations
Privilege Escalation via Kernel ExploitT1068Kernel vulnerability chained after sandbox escape to gain root / unsandboxed execution

Conclusion and Takeaways

iOS WebKit exploitation is where the abstract dangers of browser engines meet the concrete reality of a near-monoculture: because Apple's policy made WebKit the engine behind every iOS browser, web view, and message preview, a single WebKit memory-corruption bug is a foothold on hundreds of millions of devices through many delivery vectors — including zero-click via iMessage and Mail. The in-renderer technique has a stable, recognisable shape: a JavaScriptCore type confusion (or a DOM use-after-free) is parlayed into the addrof/fakeobj primitives, then a fake TypedArray, yielding arbitrary read/write across the renderer's memory. But that is only the first stage — Apple's layered defences (PAC, IsoHeaps, Gigacage, the sandbox, PPL/KTRR/KASLR) force a full real-world chain to combine multiple 0-days to climb from the renderer, through a sandbox escape, into the kernel, and finally to persistence.

That layering is the central lesson for both attackers and defenders. For attackers, it explains why complete iOS chains are scarce, expensive, and the province of well-funded actors: every stage has its own mitigation to defeat. For defenders and engine-builders, it is the blueprint — type-segregated heaps blunt UAF, caged/bounded backing stores blunt OOB, pointer authentication blunts control-flow hijack, and protected kernel structures blunt post-exploitation — and the practical user guidance is unambiguous: patch the instant updates ship, recognise that no alternative iOS browser is "safer" because they share the engine, and enable Lockdown Mode for anyone likely to be targeted. WebKit's concentration makes it the crown jewel of mobile attack surface; treating it with corresponding urgency is the only sound posture.