
Research proof-of-concept triggering a use-after-free race in the iOS IOSurfaceRootUserClient surface registry, with kalloc.24 heap grooming and stale-entry reachability probes.
Research proof-of-concept for an untrusted use-after-free style condition in the
IOSurfaceRoot IOKit user client registry (IOSurfaceRootUserClient),
affecting iOS 26.x (tested on iOS 26.4, arm64e).
The IOSurfaceRoot user client exposes external methods (selector 0x11 / 17 —
"register surface", selector 0x12 / 18 — "unregister surface") that manipulate a
kernel-side registry of surface identifiers. The lifecycle of a registry entry is
not properly serialized against concurrent lookups:
17->18->17) succeeds deterministically from userspace
(120/120 in our tests) — the registry is fully controllable from an unprivileged
app.0x11 with the stale id) with a
heap groom in place makes the kernel dereference attacker-controlled memory
from the freed-entry zone (kalloc.24):
dup returns 0xe00002c9 (NotPermitted) — the entry is dead;512 x sz=24 kernel allocations, marker values): dup returns
0x0 SUCCESS in 40/40 tries — the kernel re-validates the id against
groom-controlled bytes (STALE-READ).| Stage | Probe | Result |
|---|---|---|
| E3 | K1 control (no groom) | dup=0xC9, 0/10 — dead entry |
| E | groom + fake obj (canary 0x43414e415259) | dup=0x0, 40/40 hits |
| E2 | size sweep | sz=24 deterministic STALE-READ 10/10 |
| E4 | field mapping (f0 refcnt sweep) | f0=0x0/0x1/0x21 all hit; triple-dup d1=0x0 d2=0xC9 d3=0xC9 (entry consumed once) |
| E5 | content dependence | id field content does not change result — parse of our id-slot not confirmed |
| E6 | dup out-дамп / id-sweep / slot-shift | sync dup via structureOutput rejected (0xC2) — kernel validates out-shape before touching stale entry; id-эхо отсутствует |
| E7 | sync dup-out + size sweep 32/48/64 + refcnt-dec + zero-ctrl | см. лог |
src/entry_isurf_uaf.m — mode 407: full trigger + probe harness (stages A,B,E,E2..E7) build.sh — build script (produces build/RUSTJailbreak.ipa) docs/ — analysis notes
bash ./build.sh
Install on a jailbroken/test device, launch the app, run MODE 407.
Expected output contains sections [uaf][E], [uaf][E2] … [uaf][E7].
write-try stages use non-canonical canary addresses (0xfffffff007xxxxxx)
purely as observability markers; the kernel does not dereference them in this
build (no panic fingerprints observed in 2+ runs).MIT (research use).