iOS App Security
The iOS-specific model: a hardware-rooted platform (Secure Enclave, secure boot, Data Protection, code signing/FairPlay) with a strong app sandbox, where app-level bugs cluster around Keychain misuse, URL-scheme/universal-link handling, and WebViews, and platform bugs around parsers, the sandbox boundary, and the kernel.
Platform foundations
Apple’s integrated hardware/software stack is the baseline attackers work against: the Secure Enclave (Apple-customized L4 microkernel coprocessor) guards keys and biometrics (Touch/Face/Optic ID); secure boot and the Signed System Volume enforce OS integrity; Data Protection ties file encryption to classes (Complete, Complete-Until-First-User-Auth, etc.) derived from the passcode; code signing + FairPlay DRM gate what runs. Defense-in-depth features: BlastDoor (locked-down sandbox that parses untrusted iMessage content), Lockdown Mode, and the Apple Security Research Device. Advanced Data Protection extends end-to-end encryption to iCloud Backup, Photos and 20+ categories.
App-level attack surface
- Keychain vs. plaintext. Secrets belong in the Keychain with an appropriate accessibility class (not
NSUserDefaults/plist). MASVS-STORAGE findings dominate assessments — keyboard, screenshot and web caches leak too. A token inUserDefaultslands inLibrary/Preferences/<bundle-id>.plist, readable from a backup or with physical access; a Keychain item with deprecatedkSecAttrAccessibleAlwaysis readable in every device state. Bind sensitive items withSecAccessControlCreateWithFlags(…, kSecAttrAccessibleWhenUnlockedThisDeviceOnly, .biometryCurrentSet, …)(MASWE-0011 / CWE-922). Record accessibility class, device state and access-control flags with any Keychain finding (evilcorp-ios). - LocalAuthentication as a gate.
LAContext.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics…)returns asuccessbool to app code; one Frida hook on-evaluatePolicy:localizedReason:reply:that wraps the reply block forcestrue(MASWE-0025 / CWE-287). The fix is a Secure Enclave key gated by.biometryCurrentSetsigning a server challenge that the server verifies (evilcorp-ios). - Custom pinning in
URLSessionDelegate. A hand-writtenurlSession(_:didReceive:completionHandler:)check falls to a single hook that calls the completion handler with.useCredentialfor the presented trust (MASWE-0061 / CWE-295); see Certificate Pinning Bypass.ptrace(PT_DENY_ATTACH)anti-debug falls to hookingptraceand rewriting request 31 (MASWE-0096 / CWE-693) (evilcorp-ios). - Custom URL schemes & OAuth. Schemes are first-come-first-served but not exclusive.
ASWebAuthenticationSession(which carries Safari cookies) + an OAuthprompt=nonesilent-auth flow let a malicious app redirect through an attacker domain and capture auth codes for ~30 popular apps — account takeover bypassing PKCE. See Mobile OAuth and Deep Link Attacks. - Universal Links. The
apple-app-site-associationfile (served at/.well-known/, also cached via Apple’s CDN since iOS 14) can leak sensitive/unreleased paths; weak receiver-side validation (application:continueUserActivity:) enables spoofing (CVE-2024-10474). Verify with MASTG-TEST-0070. - WebViews / hybrid.
WKWebViewbridges andallowUniversalAccessFromFileURLs-style settings mirror the Android WebView problems; Brave’s Playlist bypassed Face ID on private tabs (PeekList). - Cross-platform. Flutter and .NET MAUI apps decompile and expose shared logic on iOS too (see Android App Security, Certificate Pinning Bypass).
Reverse engineering and resilience
- DRM is not protection. FairPlay historically required on-device decryption (Clutch, on jailbroken devices); Unfairplay (Oct 2026) decrypts IPAs offline by abusing Mac execution of iOS apps — fast, scalable, undetectable. Guardsquare’s point: static secrets and client-side policy fail; rely on obfuscation plus server-side attestation.
- Jailbreak detection and anti-debug/anti-Frida are resilience controls, not guarantees — their bypass has its own page: Jailbreak and Root Detection Bypass. Jailbreak types: tethered, semi-tethered, semi-untethered, untethered (hardest to achieve as Apple hardens and can’t be downgraded to).
- Tooling: Hopper/Ghidra/radare2 (+ r2frida), class-dump, Frida/Objection, TrollStore/FridaGadget for installation; Corellium for virtualized iOS and CVE reproduction.
Sandbox escapes and zero-click chains (current research)
- containermanagerd trust bugs.
worse_query(iOS 26.0–27.2) replaces a container part with a symlink after validation socontainermanagerdmints a read-write sandbox-extension token for another app’s container (TOCTOU, no kernel bug);worse_finderenumerates and exports every app container; CVE-2026-86886 lets an unentitled App Store app obtain extensions to system group containers (MobileGestalt cache, configuration profiles) via the privatecontainer_query_*SPI. Reaches session cookies, documents and secrets of other apps — though not Keychain or code execution. - 0-click parser chains. The recurring pattern is a privileged daemon decoding attacker content automatically. EX-ARRR: a 4-bytes-per-pixel heap overflow in
libAppleEXR.dylibreachable via an iMessage attachment before BlastDoor (LLM-guided fuzzing). DarkSword / Coruna iOS exploit kits (JavaScriptCore JIT → ANGLE OOB sandbox escape via GPU process → PE → in-memory implant) are sold and delivered through watering-hole/Instagram-ad infrastructure targeting iOS 18.4–18.6.x; APT29 chained n-days (CVE-2025-43529 et al.) in zero-click attacks. XNU bug-hunting harnesses now generate findings in bulk.
Testing
Jailbroken device (for root FS, debugging) or Corellium; Burp/ZAP + Certificate Pinning Bypass; MASVS/MASTG via OWASP MASVS and MASTG; MobSF for IPA static analysis. Practice target: evilcorp-ios (SwiftUI, iOS 16+, 30 MASVS v2/MASWE/CWE-mapped challenges with CTF flags), verified on iOS 16–18 simulators and checkm8 devices; a result on an instrumented device does not by itself show remote-attacker impact (jankesec). Keep devices patched — most exploited chains are n-days against users on old iOS.
Related
- Mobile Application Security · Android App Security · Mobile OAuth and Deep Link Attacks · Jailbreak and Root Detection Bypass · Frida · Objection · Certificate Pinning Bypass · Jailbreak and Root Detection Bypass · MASVS/MASTG
Sources
- Apple Platform Security guide · original
- iOS Security Testing (OWASP MASTG) · original
- Mobile OAuth Attacks — iOS URL Scheme Hijacking Revamped · original
- iOS Universal Links (HackTricks) · original
- worse_query: iOS sandbox escape · original
- worse_finder: every app container on iOS · original
- Sandbox extensions you were never entitled to (CVE-2026-86886) · original
- Offline IPA decryption (Unfairplay) · original
- EX-ARRR: Sailing the Apple 0-click Seas · original
- Inside DarkSword: A New iOS Exploit Kit · original
- n-day zero-click attacks on iOS and Android · original
- iOS App Reverse Engineering: Tools & Tactics · original
- Advanced Data Protection for iCloud · original
- iOS Application Security in Practice: Auditing 30 OWASP MASVS Vulnerabilities · original