Pointer Authentication was supposed to end control-flow hijacking on iOS — and for a while it looked like it had. In February 2026, an exploit chain called DarkSword showed the bypass doesn't have to break PAC at all: it can recruit the system's own pointer signer to forge valid signatures on demand. This article reconstructs that chain line by line from the leaked in-the-wild source, anchored to a pinned commit — and then lets you practice the same technique yourself: it ships with LensPic, a free hands-on lab in which you exploit a messaging app end to end, from a memory-corruption bug to signed-JOP code execution on an arm64e device-lab VM.
Verified on a live iOS 26.1 virtual device (device-lab)
On February 11, 2026, Apple released iOS 26.3, whose security document lists dozens of entries; one of them, for dyld, is unusually short: a memory corruption issue, addressed with improved state management, credited to Google TAG, with awareness of a report that this issue may have been exploited in an extremely sophisticated attack against specific targeted individuals — and, notably, on versions of iOS before iOS 26. The chain behind that entry, documented by Google as DarkSword, does something remarkable: it does not break Pointer Authentication. It recruits it. A WebKit renderer bug buys memory read/write, a dyld state confusion makes dyld rebind and sign attacker-chosen function slots, an ImageIO-resolved function pointer becomes a callable signing oracle through WebCore's invoker path, and a jump-oriented programming (JOP) thread spends the minted signatures until the sandbox falls.
This article has four parts, in the order you would learn them:
signPointer looks like on the insideThe evidence ladder, before anything else. What is proven, on what, and what is not:
hw.machine iPhone99,11, iOS 26.1 build 23B85; a virtual environment, not physical hardware, a distinction we keep explicit throughout): the oracle A/B test — a raw pointer dies at the authenticated call site while a signPointer-signed pointer executes; the signer's code bytes matching the on-disk dyld across reboots; a full signed-JOP chain through a real dyld gadget; and the messaging-driven remote solve, end to end.Apple's arm64e target is the AArch64 architecture plus the Pointer Authentication extension (introduced in ARMv8.3-A), under an ABI that defines which pointers get signed and with what discipline. The idea is elegantly small. A 64-bit virtual address on iOS uses far fewer than 64 bits, so the architecture reserves high bits of a protected pointer for a Pointer Authentication Code (PAC): a truncated MAC over three ingredients:
IA and IB for code pointers, DA and DB for data pointersNot every pointer carries a PAC. The arm64e ABI signs code pointers — function pointers and return addresses — plus data pointers explicitly annotated with __ptrauth; an ordinary C data pointer is left alone. The coverage decision is part of the design: authentication is spent where control flow depends on it. And because the code is a truncated MAC rather than a full signature, the protection is probabilistic — a forgery is not mathematically impossible, just computationally out of reach without the key.
The CPU can sign a pointer (pacia, pacib, and zero-modifier forms like paciza) and can verify and use one. The verification instructions are the gate every hijacked pointer must pass:
| Instruction | Meaning | Typical use |
|---|---|---|
blraa xN, xM | Branch with link, authenticating with the IA key and modifier xM | Indirect calls through signed function pointers |
blraaz xN | Same, modifier zero | A C function pointer with no ptrauth qualifier |
blrab / blrabz | Same, IB key | Calls signed with the B key |
braa / brab | Authenticated branch, no link | Tail calls, computed jumps |
retab | Authenticated return: verifies the link register, then returns | Epilogues of functions compiled with return authentication |
autia / autib | Authenticate in place | Verifying a pointer before use |
Two failure behaviors exist in principle. The baseline architecture does not trap on a failed aut*: it corrupts the output pointer, and the fault happens later, when that value is used. What any given implementation does — trap at the authenticate, or fail at the use — depends on the CPU and its extensions. On our test device, a bad code pointer killed by an authenticated branch arrived synchronously as EXC_ARM_PAC_FAIL and a SIGKILL, with no user-mode recovery; that observed behavior is what we report, scoped to this virtual device and build, and we have not validated it against physical hardware.
Concretely, the same C indirect call compiles differently with and without the protection:
typedef int (*cb_t)(void);
cb_t fp = get_handler();
fp();
; arm64 (no PAC): the slot is trusted as-is
ldr x8, [x20, #0x20] ; load the pointer
blr x8 ; branch — no check
; arm64e: the CPU re-derives the MAC before branching
ldr x8, [x20, #0x20] ; load the (signed) pointer
blraaz x8 ; authenticate IA key, modifier 0
Functions compiled for arm64e also authenticate their return address — prologue pacibsp, epilogue retab — unless the compiler proves plain code suffices; the signPointer disassembly below contains exactly such a plain ret on its early-exit path.
The security property is precise, and everything in this article flows from it:
PAC does not stop you from writing a pointer. It stops you from writing one that passes authentication.
An attacker with arbitrary memory read/write can overwrite any pointer in the process. Pre-PAC, that is game over. On arm64e the overwritten pointer is dead on arrival unless its MAC is valid for exactly the key and modifier the call site expects, and the hardware keys are not readable. In practice, though, every validly signed pointer was produced by a legitimate signing path — software running in the same process — and such a path can become an oracle when a vulnerability exposes it to attacker-chosen inputs. The rest of this article is about reaching it.
A signing oracle is any legitimate in-process code path that computes sign(target, key, modifier) for inputs an attacker influences and hands the result back. The moment you can make a real signer sign for you, the PAC barrier becomes a door: mint a correctly signed pointer to any target, plant it in the slot you found, and the authenticated branch at that call site passes — because from the CPU's perspective the signature is genuine. It is genuine.
Bypasses of PAC come in several shapes; three categories organize this article (a selection, not an exhaustive taxonomy):
signPointerdyld signs pointers constantly: GOT and lazy-symbol entries, chained-fixup targets, interposing replacements. Its internal routine does the signing, and it lives in every process. On our 23B85 device it is the function at dyld_base + 0x304c0, demangled signPointer(uintptr_t ptr, void* ctx, bool addrDiv, uint16_t diversity, ptrauth_key key). We verified the identification two ways: the bytes read from live memory match /usr/lib/dyld on disk across reboots (it is the code that is stable — signed pointer values vary per boot), and the A/B test below only works if the address is exactly this routine. Its body, disassembled from the device binary:
__Z11signPointeryPvbt11ptrauth_key:
304c0: cbz x0, 0x30528 ; NULL in, NULL out
304c4: mov w8, w3
304c8: bfi x1, x8, #48, #16 ; pack the diversity into ctx's high bits
304cc: cmp w2, #0x0
304d0: csel x16, x8, x1, eq ; modifier = diversity, or blend(ctx, diversity)
...
30510: mov x17, x0
30514: pacia1716 ; mint an IA signature with modifier x16
30524: mov x0, x17
30528: ret
Read the two branches and you can see the whole API. w4 selects the key (0 means IA), w3 is the diversity, and w2 (addrDiv) selects whether the modifier is the bare diversity or ctx|diversity; the selected pacia/pacib/pacda/pacdb instruction mints the signature. One special case matters enormously: modifier zero with key IA is precisely what an unqualified C indirect call site (blraaz) re-derives at run time. If you can reach this routine with (target, anything, 0, 0, 0), you can mint a pointer that passes every such call site in the process.
One clarification for what follows: DarkSword does not invoke this helper with this five-argument ABI directly; its oracle reaches the ChainedFixupPointerOnDisk::Arm64e::signPointer(loc, target) member wrapper, which derives these signing parameters from the forged chained-fixup descriptor (x0 = forged descriptor, x1 = loc, x2 = raw target).
The A/B test that defines the technique, from our paclab harness on the device:
[*] render_fp = raw flag address → EXC_BAD_ACCESS (Termination Reason: PAC)
[*] render_fp = signPointer(flag, IA, 0) → flag executed, marker observed
Same slot, same write primitive, same target address. The only difference is who computed the high bits. One routine, one call, and the barrier opens. This is the DarkSword primitive in isolation.
DarkSword is a six-vulnerability chain that Google observed targeting iOS 18.4 through 18.7, delivered from websites — compromised sites and watering holes serving a hidden iframe, with a fake Snapchat login page as the lure — and driving full compromise from a single page visit. (That Snapchat page was the operators' delivery disguise; it has nothing to do with the apps themselves. Our lab target, LensPic, is an Instagram-style remake — the lure is history, the messenger is the exercise.) The leaked worker script is public in the htimesnine/DarkSword-RCE repository, and the renderer stages below are anchored to a pinned commit (af5994e2, March 2026). Line numbers elsewhere may drift as the repository changes.
| Stage | CVE | Component | Role |
|---|---|---|---|
| Renderer RCE (18.4–18.5) | CVE-2025-31277 | JavaScriptCore | Initial memory corruption |
| Renderer RCE (18.6–18.7.2) | CVE-2025-43529 | JavaScriptCore DFG JIT | Initial memory corruption |
| PAC bypass | CVE-2026-20700 | dyld | Forge PAC-valid pointers |
| Sandbox escape 1 | CVE-2025-14174 | ANGLE (WebGL) | WebContent → GPU process |
| Sandbox escape 2 | CVE-2025-43510 | XNU copy-on-write | GPU → mediaplaybackd |
| Privilege escalation | CVE-2025-43520 | XNU VFS race | Kernel read/write |
This article zooms into the third row — the one the emergency release patched — and reads its stages as one continuous answer to a single question: given arbitrary read/write, how do you get from memory corruption to a callable, PAC-valid signer?
The chain opens in Safari's WebContent process with a JavaScriptCore memory-corruption bug (CVE-2025-31277 on iOS 18.4–18.5, CVE-2025-43529 on later builds). The worker script carries the resulting primitives openly — p.addrof at line 285, p.write64 at line 318, p.read64 at line 350 — and because every process maps dyld, this read/write reaches dyld's image directly; the chain derives the slides it needs at runtime. Nothing PAC-related has happened yet; the chain simply owns the address space.
af5994e2: p.addrof (line 285), p.write64 (line 318), p.read64 (line 350).This is the CVE-2026-20700 stage. Apple's advisory confirms a dyld state-management flaw reachable with a memory-write capability; Google attributes DarkSword's PAC bypass to it; the precise mechanism is our one inferred link, flagged in the evidence ladder and at the end of this section. The worker's target is dyld's interposing machinery — the sanctioned symbol-replacement feature: a library declares (replacement, original) tuples, and dyld rebinds matching symbols to the replacement when it builds its interposing tables.
write64 calls corrupt a stack-resident lsl::Vector<T>, and dyld's own destructor path turns the forgery into a controlled addition that retargets the interposing table.Arbitrary read/write in the renderer does not bypass memory protections: dyld’s interposing state is protected against ordinary writes. The exploit therefore corrupts a vector on a writable thread stack, then uses the AVSpeech-triggered loading sequence to make dyld’s own allocator perform the writes to that protected state.
The short version: the worker derives the RuntimeState fields behind that machinery at lines 507 to 511, calibrates dyld's slide from an offset it calls dyld__RuntimeState_emptySlot at line 536, finds a suspended dlopen_from stack frame by scanning a worker thread's stack at lines 538 to 545, and corrupts the stack-resident lsl::Vector<T> inside it — the two write64 calls at lines 557 to 565. Those writes change nothing by themselves; the payload lands when dyld destroys the corrupted vector and the forged allocator turns Allocator::free into a controlled addition. Phase one ends with InterposeTupleAll._buffer pointing at the worker's typed array (trigger: AVSpeechSynthesisVoice); phase two (lines 602 to 622) sets _size = 0x100 (trigger: AVSpeechUtterance). The leaked offset names name the aliased fields: RuntimeState_emptySlot, RuntimeState_vtable, dlopen_from_lambda_ret.
Why interposing? Because dyld rebuilds its interposing tables by walking that vector — and when the vector is made to describe attacker memory, dyld rebinds and re-signs the replacement entries itself.
With _buffer and _size forged, the worker fills a plain BigInt array with interposing tuples via the interpose(ptr, val) helper at lines 623 to 626, then waits for the second corruption phase to complete: while (p.read64(p.p_InterposeTupleAll_size) != 0x100n); at line 636 — _size == 0x100 confirms that the forged 256-entry InterposeTupleAll vector is visible to dyld. A subsequent WebCore/ImageIO path causes dyld to consume those entries and rebind the selected function slots. The table at lines 628 to 635 tells the story in one glance — an invoker gadget here, libdyld__dlopen and libdyld__dlsym there, and the entry that matters: CMPhotoCompressionSessionAddExif → dyld__signPointer. When the rebuild finishes, the ImageIO compression session's AddExif slot holds dyld's signPointer — already signed by dyld.
dyld__signPointer — and dyld signs the entry itself.ImageIO's symbol-resolution machinery populates its gFunc slots with the interposed, PAC-valid function pointers. The worker retrieves the signed signPointer pointer from the AddExif slot (lines 666 to 667 — the variable name records what the value is: a paciza-signed signPointer) and invokes it through the WebCore/invoker machinery with attacker-controlled arguments: slow_pacia at lines 731 to 733 packs a chained-fixup descriptor as the self argument, with the raw target traveling in x2 (line 684); the sibling slow_pacib mints IB-key variants for stack-context call sites.
x0, the raw target in x2, a hardware-key-signed pointer back.
slow_pacia and slow_pacib (lines 731–737): the 0x8001… / 0x8003… descriptor words select the key and address diversity; the raw target travels in x2.Notice what stage 2 bought. A raw pointer planted into an authenticated call site dies at first use — that death is our paclab A/B from section 2, measured. DarkSword never relies on a raw code pointer surviving an authenticated call site; it makes dyld produce the correctly signed value first, which is the only reason the oracle is callable at all. CVE-2026-20700's role is reachability: turning "I have a write primitive" into "I have a callable, PAC-valid signer."
One signed pointer is not code execution; the target still needs arguments, and mid-function gadgets have no pre-existing signature to replay. So the chain builds a register-controlled call primitive out of harvested gadgets, each minted through the oracle like any other pointer (lines 763 to 776), and spawns a JOP thread at line 782 by calling pthread_create with paciza_gadget_loop_3 as the start routine. On top of the gadget loop sits fcall at lines 853 to 855: every target is signed on first use with cache.set(pc, pacia(pc, 0n)) — IA/0, the same recipe our lab uses — then driven through the control gadgets with up to eight attacker-chosen arguments (lines 869 to 886). With fcall in hand the script does what any C program does: dlopen, dlsym, fopen, thread_suspend on its sibling workers (lines 888 to 908).
fcall (lines 847–855): every target is signed IA/0 on first use and cached — the same recipe our lab uses.Both instruction keys are in play: callable targets are minted IA/0, while the JOP loop's own stack links are IB-key gadgets with stack-derived modifiers (pacib_gadget_loop_1_0x80020, pacib_gadget_loop_2_0x80010, lines 805 to 810) — a return address authenticates with the B key and its stack context. So the chain does not need to introduce attacker-controlled unsigned executable pages; it reuses already executable, trusted code with attacker-controlled data and control flow.
The remaining stages climb out of the renderer: the ANGLE bug (CVE-2025-14174) escapes WebContent into the GPU process, an XNU copy-on-write bug reaches mediaplaybackd, and a VFS race wins the kernel — each also implemented in JavaScript with fcall available. That climb is outside this article's scope; opa334's kernel reimplementation confirms the chain's provenance.
dlopen_from lambda state, and the 26.3↔26.4 diff growing the interposing machinery — buildInterposingTables by 52 bytes, appendInterposingTuples by 132, Loader::interpose by 180 (code-size deltas from the builds' symbol tables). Growth alone is not proof of new checks, and we have not instruction-level diffed these functions; the numbers establish only where the follow-up release spent code. Stage 2's mechanism now also has independent corroboration (the notsunde analysis cited above), but on our ledger the empty-slot consumption itself remains inferred until we run it on hardware. The confusion we believe CVE-2026-20700 enables most plausibly rides the loader array's empty-slot handling, which that lambda state manages.Reading about oracles teaches taxonomy; building one teaches the craft. LensPic — the Mobile Hacking Lab target app, an Instagram-style messenger remake — is a teaching model of the section-3 technique, not a full DarkSword reproduction, and we want the boundary explicit before you touch it:
lenskit, flag, dyld, state) ride in every pipeline reply's sdk: line, where the ITW worker derived them at runtime; the lk_g_oracle helper is compiled -fno-ptrauth-calls with a target gate, standing in for the invoker gadgets the chain harvested from existing binaries; one JOP trampoline (lk_g_head) is provided. The dispatcher gadget, by contrast, is not given — you hunt it in dyld's __TEXT yourself.With that frame, the exercise is the technique itself. LensPic's lens parser carries a modelled integer overflow; you turn it into a leak, escalate to arbitrary read and write, meet the PAC barrier with a raw pointer, then recruit the SDK's own update step as your signing oracle, hunt a dispatcher gadget in dyld's __TEXT, and close a signed JOP chain that calls flag with an argument you choose. The full level walkthrough and build settings ship with the lab — deliberately not here, because deriving them is the exercise.
flag executing with x0 under attacker control. The crash that follows the capture is expected and documented; taking the flag and dying is an accepted JOP outcome, and full return control is what the ITW gadget loop was for.Run it yourself. The LensPic lab is available free on the Mobile Hacking Lab academy: academy.mobilehackinglab.com/course/lab-lenspic. The lab page hosts the target app, the messaging backend, and two shared helper scripts — a messaging client (send text and lens attachments to the device) and a gadget scanner for the dispatcher hunt:
python3 messaging.py lp-xxxxxxxx --text "hi" --attach demo.lens # talk to the device
python3 find_gadgets.py # hunt the dispatcher gadget
The exercise, in the order the article taught it: crash the THUMB decoder; turn the overflow into a leak; escalate to arbitrary read; locate flag, dyld, and the SDK state; die on the PAC barrier with a raw pointer; stage the update step and harvest your first minted signature; hunt the dispatcher gadget in dyld's __TEXT; build the signed JOP chain; execute flag with an argument of your choosing. The oracle semantics, the gadget hunt, and the JOP discipline are the transferable skills — on this device they ran against enforced PAC. What the lab gave away was the reachability, the ground-truth addresses, and one trampoline; everything you actually practiced was the real mechanism.
Want to go from reading chains to finding bugs? iOS Userland Fuzzing & Exploitation is the deep version of this article: real fuzzing harnesses against iOS native libraries, zero-click attack surface analysis, CVE deep dives, heap attacks, and full chain construction on a live jailbroken device. The free ARM64 Crash Course and LLDB & iOS Debugging sections are where to start if assembly and the debugger are still the gap.
The flag itself stays in the lab: bring it back as your own proof. What dyld signed was the pointer that reached it.
af5994e246eb7ba4157e433d80a3e2b4dd503ee3 (all section-3 line citations resolve against this commit): rce_worker.js primitives L285, L318, L350; RuntimeState/interpose setup L507-L511, L536-L545, loader rewrite L557-L565, L602-L615; tuple table L623-L637; oracle read-back and invocation L656-L667, L731-L734; gadget harvest L763-L776, JOP thread L781-L782; fcall L847-L855, L869-L886; post-exploit L888-L908. Repository: https://github.com/htimesnine/DarkSword-RCEdlopen_from vector-metadata / Allocator::free controlled-add path used in Stage 2)__ptrauth qualifiers) and command-line argument reference (-fno-ptrauth-calls)hw.machine iPhone99,11, hw.model VPHONE600AP), iOS 26.1 build 23B85, reached over SSH as root — not physical hardware; see the caveats in section 1.Courses referenced in this article: the iOS Userland Fuzzing & Exploitation advanced course, and the free ARM64 Crash Course and LLDB & iOS Debugging Fundamentals sections, all at Mobile Hacking Lab.