iMessage Media Parser Zero-Click → CoreAudio RCE → PAC/RPAC → Kernel → CryptoTokenKit Abuse
Reading time: 7 minutes
tip
Ucz się i ćwicz Hacking AWS:HackTricks Training AWS Red Team Expert (ARTE)
Ucz się i ćwicz Hacking GCP: HackTricks Training GCP Red Team Expert (GRTE)
Ucz się i ćwicz Hacking Azure:
HackTricks Training Azure Red Team Expert (AzRTE)
Wsparcie dla HackTricks
- Sprawdź plany subskrypcyjne!
- Dołącz do 💬 grupy Discord lub grupy telegramowej lub śledź nas na Twitterze 🐦 @hacktricks_live.
- Dziel się trikami hackingowymi, przesyłając PR-y do HackTricks i HackTricks Cloud repozytoriów na githubie.
This page summarizes a modern iOS zero-click attack surface and an observed end-to-end exploitation chain abusing iMessage automatic media parsing to compromise CoreAudio, bypass BlastDoor, defeat Pointer Authentication (PAC) via an RPAC path, escalate to kernel, and finally abuse CryptoTokenKit for unauthorized key uses.
Warning: This is an educational summary to help defenders, researchers, and red teams understand the techniques. Do not use offensively.
High-level chain
- Delivery vector: a malicious audio attachment (e.g., .amr / MP4 AAC) sent via iMessage/SMS.
- Auto-ingestion: iOS auto-parses media for previews and conversions without user interaction.
- Parser bug: malformed structures hit CoreAudio’s AudioConverterService and corrupt heap memory.
- Code exec in media context: RCE inside the media parsing process; reported to bypass BlastDoor isolation in specific paths (e.g., “known sender” framing path).
- PAC/RPAC bypass: once arbitrary R/W is achieved, a PAC bypass in the RPAC path enables stable control flow under arm64e PAC.
- Kernel escalation: the chain converts userland exec into kernel exec (e.g., via wireless/AppleBCMWLAN code paths and AMPDU handling as seen in logs below).
- Post-exploitation: with kernel, abuse CryptoTokenKit to perform signing with Secure Enclave–backed keys, read sensitive data paths (Keychain contexts), intercept messages/2FA, silently authorize actions, and enable stealth surveillance (mic/camera/GPS) without prompts.
iMessage/BlastDoor attack surface notes
BlastDoor is a hardened service designed to parse untrusted message content. However, observed logs indicate paths where protections may be bypassed when messages are framed from a “known sender” and when additional filters (e.g., Blackhole) are relaxed:
IDSDaemon BlastDoor: Disabled for framing messages
SpamFilter Blackhole disabled; user has disabled filtering unknown senders.
Wnioski:
- Auto-parsing nadal stanowi zdalną powierzchnię ataku typu zero-click.
- Decyzje dotyczące polityki/kontekstu (known sender, filtering state) mogą istotnie zmienić efektywną izolację.
CoreAudio: AudioConverterService heap corruption (userland RCE)
Dotknięty komponent:
- CoreAudio → AudioConverterService → AAC/AMR/MP4 parsing and conversion flows
Zaobserwowany parser touchpoint (logs):
AudioConverterService ACMP4AACBaseDecoder.cpp: inMagicCookie=0x0, inMagicCookieByteSize=39
Technique summary:
- Nieprawidłowe metadane kontenera/kodeka (np. invalid/short/NULL magic cookie) powodują korupcję pamięci podczas inicjalizacji dekodera.
- Wywoływane w ścieżce konwersji mediów iMessage bez interakcji użytkownika.
- Skutkuje wykonaniem kodu w procesie parsowania mediów. Autor opisu twierdzi, że to omija BlastDoor w obserwowanej ścieżce dostarczania, umożliwiając kolejny etap.
Practical tips:
- Fuzzuj AAC/AMR magic cookie i MP4 codec atoms przy celowaniu w konwersje AudioConverterService.
- Skoncentruj się na heap overflows/underflows, OOB reads/writes oraz size/length confusion wokół decoder initialization.
PAC bypass via RPAC path (CVE-2025-31201)
arm64e Pointer Authentication (PAC) utrudnia przejęcie adresów powrotu i wskaźników funkcji. Opis łańcucha wskazuje na przełamanie PAC używając ścieżki RPAC po uzyskaniu arbitrary read/write.
Key idea:
- Mając arbitrary R/W, atakujący mogą wykreować poprawne, ponownie podpisane wskaźniki lub pivotować wykonanie do ścieżek tolerujących PAC. Tzw. “RPAC path” umożliwia kontrolę przepływu sterowania w ramach ograniczeń PAC, przekształcając userland RCE w wiarygodną konfigurację kernel exploit setup.
Notes for researchers:
- Zbieraj info leaks, aby pokonać KASLR i ustabilizować ROP/JOP chains nawet przy PAC.
- Celuj w callsites, które generują lub uwierzytelniają PAC w kontrolowalny sposób (np. signatures generated on attacker-controlled values, predictable context keys, lub gadget sequences które re-sign pointers).
- Spodziewaj się wariancji w hardeningu Apple zależnie od SoC/OS; niezawodność opiera się na leaks, entropii i solidnych primitives.
Kernel escalation: wireless/AMPDU path example
W obserwowanym łańcuchu, po uzyskaniu dostępu w userland z memory corruption i PAC bypass primitive, kontrola nad kernelem została osiągnięta przez ścieżki kodu w stosie Wi‑Fi (AppleBCMWLAN) przy błędnym przetwarzaniu AMPDU. Przykładowe logi:
IO80211ControllerMonitor::setAMPDUstat unhandled kAMPDUStat_ type 14
IO80211ControllerMonitor::setAMPDUstat unhandled kAMPDUStat_ type 13
Ogólna technika:
- Użyj userland primitives, aby zbudować kernel R/W lub kontrolowane ścieżki wywołań.
- Nadużywaj dostępnych powierzchni jądra (IOKit, networking/AMPDU, media shared memory, Mach interfaces), aby osiągnąć kontrolę PC jądra lub arbitralny dostęp do pamięci.
- Stabilizuj, budując read/write primitives i omijając ograniczenia PPL/SPTM tam, gdzie to możliwe.
Post-eksploatacja: CryptoTokenKit i nadużycia identity/signing
Gdy kernel zostanie przejęty, procesy takie jak identityservicesd mogą być podszyte, a uprzywilejowane operacje kryptograficzne wywołane przez CryptoTokenKit bez monitów użytkownika. Przykładowe logi:
CryptoTokenKit operation:2 algo:algid:sign:ECDSA:digest-X962:SHA256
CryptoTokenKit <sepk:p256(d) kid=9a86778f7163e305> parsed for identityservicesd
Impact:
- Użycie kluczy zabezpieczonych przez Secure Enclave do nieautoryzowanego podpisywania (tokenów, wiadomości, płatności), łamiąc modele zaufania nawet jeśli klucze nie są eksportowane.
- Przechwytywanie kodów/wiadomości 2FA w sposób niewidoczny; autoryzowanie płatności/przelewów; aktywacja ukrytego mikrofonu/kamery/GPS.
Defensive angle:
- Traktować naruszenia integralności po warstwie jądra jako katastrofalne: wymagać runtime attestation dla konsumentów CTK; minimalizować ambient authority; weryfikować entitlements w punkcie użycia.
Reproduction and telemetry hints (lab only)
- Delivery: send a crafted AMR/MP4-AAC audio to the target device via iMessage/SMS.
- Observe telemetry for the foregoing log lines around parsing and wireless stack reactions.
- Ensure devices are fully patched; only test in isolated lab setups.
Mitigations and hardening ideas
- Patch level: iOS 18.4.1 reportedly fixes this chain; keep devices up to date.
- Parser hardening: strict validation for codec cookies/atoms and lengths; defensive decoding paths with bounds checks.
- iMessage isolation: avoid relaxing BlastDoor/Blackhole in “known sender” contexts for media parsing.
- PAC hardening: reduce PAC-gadget availability; ensure signatures are bound to unpredictable contexts; remove PAC-tolerant bypassable patterns.
- CryptoTokenKit: require post-kernel attestation and strong entitlements at call-time for key-bound operations.
- Kernel surfaces: harden wireless AMPDU/status handling; minimize attacker-controlled inputs from userland after compromise.
Affected versions (as reported)
- iOS 18.x prior to iOS 18.4.1 (April 16, 2025).
- Primary: CoreAudio → AudioConverterService (media auto-parsing path via iMessage/SMS).
- Chained: PAC/RPAC path and kernel escalation via AppleBCMWLAN AMPDU handling.
References
tip
Ucz się i ćwicz Hacking AWS:HackTricks Training AWS Red Team Expert (ARTE)
Ucz się i ćwicz Hacking GCP: HackTricks Training GCP Red Team Expert (GRTE)
Ucz się i ćwicz Hacking Azure:
HackTricks Training Azure Red Team Expert (AzRTE)
Wsparcie dla HackTricks
- Sprawdź plany subskrypcyjne!
- Dołącz do 💬 grupy Discord lub grupy telegramowej lub śledź nas na Twitterze 🐦 @hacktricks_live.
- Dziel się trikami hackingowymi, przesyłając PR-y do HackTricks i HackTricks Cloud repozytoriów na githubie.