Skip to content

About

PoC on kernel panic ios 18.7.2 iphone xr

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

51 Commits

Folders and files

Repository files navigation

iOS 18.7.2 / A12 kernel control research

CVE-2026-28992 CVE-2026-20687 Platform Status License Build

iOS 18.7.2 / A12 — kernel control research

Two kernel bugs on the spare iPhone XR, researched from Windows/WSL with no Mac in the loop:

  • CVE-2026-28992 — IOHIDFamily fast-path open/teardown race. Stable kernel panic, but crash-only on the reachable SPU provider.
  • CVE-2026-20687 — AppleJPEGDriver decoder timeout UAF. Reproducible deferred panic, controlled 10 s free, and same-type reclaim without a panic.

This is not a jailbreak. No kernel read/write yet. The repository documents the crash → UAF → controlled free/reclaim ladder. It does not bypass PAC/PPL/SPTM, does not install anything, and does not provide arbitrary kernel memory access.

«Паника — это не конец. Это доказательство, что мы уже в ядре.» Crash → Control → Jailbreak.

Kernel control status

Level State
0. Crash PASS — IOHID and AppleJPEG signatures reproduced
1. Reproducible UAF PASS — AppleJPEG JpegRequest read after free
2. Controlled free PASS — sel1 sync returns kIOReturnTimeout after 10.001 s
3. Same-type reclaim PASS — 10 async allocations after the timeout, kernel survives
4. Persistent stale node PARTIAL — immediate close produces a setPowerState wedge
5. Write / read primitive NOT YET
6. PAC / PPL bypass NOT YET
7. Kernel r/w + jailbreak NOT YET

The direct PC-control path from the public PoC is PAC-protected on A12 (autda + blraa), so the next gate is a double-free/write primitive, not a fake vtable. Read the full reasoning in docs/kernel-control.md.

The jailbreak project built on this research is Hidra — target device, architecture, milestones, and the current release estimate live there.

18.7.2 candidate audit and CandProbe

The 18.7.2 → 18.7.10 binary audit found the strongest app-reachable kernel-code-execution candidate so far: AVEVideoEncoder / CVE-2026-64747 in AppleAVE2 803.73.1. The 18.7.10 update (803.73.3) adds overflow checks to the AVE_CalcBufSizeOf* cluster and an explicit width >= 0 && height >= 0 && iPixelProduct <= 2147483647 check. The 18.7.2 driver accepts the open parameters without that check.

CandProbe independently tests VideoToolbox, the raw AppleAVE2Driver selector 1, the 18.7.2 selector table, media/GPU/HID userclients, and the Mach/VM edge cases. Every risky call leaves a fsynced breadcrumb in Documents/candprobe-state.txt.

IOHID path — CVE-2026-28992

Status

Item Value
CVE CVE-2026-28992
Component com.apple.iokit.IOHIDFamily — IOHIDEventServiceFastPathUserClient
Bug class Race condition / use-after-free
Reachable from Normal app sandbox, no entitlements required
Patched in iOS 18.7.9 / iPadOS 18.7.9 and iOS 26.5 / iPadOS 26.5
Tested on iPhone XR (iPhone11,8), iOS 18.7.2 (22H124), A12
Result Kernel data abort / panic, device reboots
Control status Crash-only on the reachable SPU provider

The IOHID fast-path object is provider-side: copyEvent never delivers an event on this target (245,808 attempts, all kIOReturnNoResources), so the free cannot be raced from userland. The next control lead is CVE-2026-20687 in AppleJPEGDriver.

The original IOHID research and PoC were published by Johnny Franks (@0xjohnny). This repository contains a standalone build of the same technique, with service enumeration and a panic-log analysis from the 18.7.2/A12 target.

Research roadmap

Crash to control to jailbreak roadmap

The roadmap below is the original IOHID path; the current AppleJPEG ladder is the table at the top of this README.

Patch timeline

CVE-2026-28992 patch timeline

Root cause

IOHIDEventServiceFastPathUserClient gates sel0 on the FastPathHasEntitlement and FastPathMotionEventEntitlement keys in the caller-supplied OSDictionary, instead of the entitlement flags stored during initWithTask. A sandboxed app can therefore pass the gate by putting those keys in its input dictionary.

Two connections to the same IOHIDEventService provider then operate in different locking domains:

  • sel1 (close) drops provider state and clears +0x109 without the lock;
  • sel2 (copyEvent) checks +0x108 under a per-connection lock and then calls into the provider.

The AOP variant additionally uses mach_port_destroy on probe connections to fire asynchronous didTerminate/teardown while opener threads walk the same provider state.

FastPath open/teardown race diagram

What this PoC does

  1. Enumerates every IOHIDEventService in the IORegistry.
  2. Opens up to 32 type=2 user clients per service and gates each one with the entitlement-bypass XML dictionary.
  3. Picks the first provider with at least two successful gates.
  4. Keeps eight gated connections.
  5. Runs three close/reopen churn threads.
  6. For 120 seconds, repeatedly opens 16 probe connections, gates them, and destroys them with mach_port_destroy (80 ms race window).

On the tested 18.7.2/A12 device, this crashes in the provider's open/teardown path.

Expected panic

Panicked task ... pid ...: hidgate4
Kernel data abort
pc  = 0xfffffff02405c388
x16 = 0x0020000000000000
far = 0x0020000000000038
esr = 0x96000004

0xfffffff008424388:  ldr x8, [x16, #0x38]!

Kernel data abort panic excerpt

The faulting instruction is a virtual call through a corrupted object pointer. The backtrace contains IOHIDFamily and AppleSPU, which is consistent with the FastPath open/teardown race.

See docs/panic-analysis.md for the redacted analysis.

AppleJPEG path — CVE-2026-20687

Apple: "An app may be able to cause unexpected system termination or write kernel memory." Fixed in iOS 18.7.7 / iPadOS 18.7.7 and iOS 26.4 / iPadOS 26.4. The 18.7.2 kext is AppleJPEGDriver 7.6.9.

What works on the test device:

  1. IOServiceOpen("AppleJPEGDriver", type 0) succeeds from the app sandbox.
  2. sel1 accepts the 0x58-byte AppleJPEGDriverIOStruct; both sync and async decodes work.
  3. Five async decodes plus close, then Camera, produce a deferred kernel data abort inside AppleJPEGDriver:
pc  = ... (AppleJPEGDriver)
x5  = 0xfeedfacefeedfacf
x6  = 0xfeedfacefeedfacf
x12 = 0
far = 0x308

0xfffffff008df3418:  ldrb w12, [x12, #0x308]
  1. An 8000-request mass prime drives a true sync decode into kIOReturnTimeout (0xe00002d6, dt=10.001s).
  2. Ten async requests on the same connection immediately after the timeout reclaim the freed JpegRequest; the kernel survives.
  3. Closing immediately after the reclaim leaves the driver wedged in setPowerState(1 -> 0) (10.2 s watchdog). That is a DoS, not control.

Full details:

Final tests

The reproducible test matrix (T1–T9), exact log lines, pass/fail criteria, and log-collection steps are in docs/final-tests.md.

Open-source PoC — MOON

The runnable concept PoC is MOON in PoC/applejpeg/. It is a small, readable app that:

  1. opens AppleJPEGDriver from the app sandbox;
  2. validates the 0x58 decode ABI;
  3. primes five async decodes and closes the connection;
  4. asks you to open Camera, which triggers the deferred UAF.

Build on macOS:

make applejpeg
# or: ./PoC/applejpeg/build.sh

Output: build/MOONProbe-unsigned.ipa. The build-applejpeg-poc GitHub Actions workflow builds the same IPA and uploads it as the moonprobe-unsigned-ipa artifact.

Run it only on a spare device. Expected result: a kernel panic in AppleJPEGDriver with far=0x308 after Camera opens. Full instructions: PoC/applejpeg/README.md. The chain name and stages are documented in docs/moon-chain.md.

Build

No prebuilt .ipa is committed. Build it yourself from source and sign it with your own certificate or sideloading tool.

One command (macOS)

make
# or: ./build.sh

This produces:

build/Payload/hidgate4.app
build/hidgate4-unsigned.ipa

The IPA is unsigned. Sign it with your normal workflow (Xcode, codesign, ldid, AltStore, TrollStore, etc.) before installing.

Xcode

  1. Create a new iOS App project (Objective-C, UIKit).
  2. Replace ViewController.m/main.m with PoC/main.m.
  3. Add IOKit.framework and Foundation.framework.
  4. Set a bundle identifier and sign with your development team.
  5. Install on a test device you own and launch.

Manual command line (macOS)

SDK=$(xcrun --sdk iphoneos --show-sdk-path)
xcrun -sdk iphoneos clang -arch arm64 -isysroot "$SDK" -fobjc-arc -fblocks \
  -O2 -c PoC/main.m -o main.o
xcrun -sdk iphoneos clang -arch arm64 -isysroot "$SDK" \
  -o hidgate4 main.o -framework UIKit -framework Foundation -framework IOKit
python3 scripts/package_ipa.py hidgate4.app hidgate4-unsigned.ipa

GitHub Actions

The workflow in .github/workflows/build.yml builds an unsigned IPA on a macOS runner and uploads it as the hidgate4-unsigned-ipa artifact. You can run it manually from the Actions tab.

Research log

The full crash-to-control log is docs/experiment-log.md. Variant sources live in experiments/ and experiments/applejpeg/.

Short version:

  • IOHID close/open is the trigger; generic and targeted sprays did not reclaim the provider-side object. copyEvent never delivers an event on this SPU, so the IOHID path is crash-only.
  • AppleJPEG sel1 sync/async works from the app sandbox. The deferred UAF is reproducible via Camera, and the 10 s timeout can be forced on demand.
  • The same-type reclaim after the timeout survives; immediate close produces a power-state wedge. The next goal is a double-free/write primitive, not a fake vtable.

Project page (GitHub Pages)

The docs/ directory contains a self-contained dark landing page with the banner, race diagram, panic card, and timeline.

To enable it:

  1. Repository Settings → Pages
  2. Build and deployment → Deploy from a branch
  3. Branch main, folder /docs
  4. Save

After that the page is available at:

https://hidra0x.github.io/hidgate-poc/

Instant preview without enabling Pages:

https://raw.githack.com/hidra0x/hidgate-poc/main/docs/index.html

Direct links

Repository docs

CVE-2026-20687 (AppleJPEGDriver)

CVE-2026-28992 (IOHIDFamily)

Warning

  • The IOHID PoC will panic the kernel and reboot the device.
  • The AppleJPEG builds can panic, reboot, or wedge the JPEG driver's power state (setPowerState(1 -> 0) timeout).
  • Do not run any of this on a primary phone.
  • Save your work first.
  • The PoCs are intentionally aggressive: the IOHID baseline keeps 16 probe connections every 80 ms for 120 seconds; the AppleJPEG prime can submit thousands of decodes.

Credits

License

MIT. See LICENSE.

About

PoC on kernel panic ios 18.7.2 iphone xr

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages