iOS binary & device checks

iOS IPA security testing: FairPlay DRM and real devices

Testing an iOS release starts with the right build artifact. Understanding Apple FairPlay DRM encryption, unencrypted IPA export checks, and public device re-signing keeps your findings grounded in verifiable evidence.

Why App Store IPAs cannot be statically analyzed for code

Every iOS app distributed through the Apple App Store has its executable code protected by Apple FairPlay DRM. Inside the Mach-O binary, Apple encrypts the __TEXT segment and records the protected byte range in the LC_ENCRYPTION_INFO_64 load command with cryptid=1. Only iOS on an authorized Apple device decrypts those pages when the binary is mapped into memory.

Because FairPlay encrypts the executable pages rather than the entire zip container, an App Store IPA still exposes surrounding metadata inside Payload/*.app/. Files such as Info.plist, embedded provisioning profiles, entitlements in the code signature, asset catalogs, privacy manifests (PrivacyInfo.xcprivacy), and the embedded framework directory layout remain readable. However, static binary inspection — including string scanning inside compiled Swift or Objective-C code, API usage checks, crypto call tracing, and Mach-O hardening verification — cannot read encrypted instructions.

An authorized assessment should never depend on stripping FairPlay DRM from a store download. Instead, the iOS engineering team exports an unencrypted development or ad-hoc IPA from the same commit and build pipeline so static analyzers and human validators inspect the real executable code cleanly.

How to export and verify an unencrypted dev or ad-hoc IPA

In Xcode, create an archive via Product → Archive and distribute it using the Development or Ad Hoc method rather than App Store Connect. In CI pipelines, archive the release scheme and run xcodebuild -exportArchive with an ExportOptions.plist whose method key is set to development or ad-hoc.

Before uploading the archive to a static or real-device scanner, inspect the Mach-O load commands with otool -l and record the package SHA-256 digest so every downstream report binds cryptographically to the exact build:

xcodebuild -exportArchive \
  -archivePath build/App.xcarchive \
  -exportOptionsPlist ExportOptions-AdHoc.plist \
  -exportPath build/ipa-out

unzip -q build/ipa-out/App.ipa -d /tmp/ipa-verify
otool -l /tmp/ipa-verify/Payload/App.app/App | grep -A4 LC_ENCRYPTION_INFO_64
# Expected: cryptid 0 (or no LC_ENCRYPTION_INFO_64 command)

shasum -a 256 build/ipa-out/App.ipa

An unencrypted build either prints cryptid 0 or omits LC_ENCRYPTION_INFO_64 entirely. Check embedded dynamic frameworks under Payload/App.app/Frameworks/ as well if you ship first-party modules. If any binary shows cryptid 1, stop and re-export from Xcode rather than running a partial static scan against encrypted code.

What static IPA review surfaces

Once an authorized, unencrypted IPA is verified, static analysis inspects both bundle configuration and compiled binary indicators mapped to OWASP MASVS control areas:

  • App Transport Security (ATS) exceptions (MASVS-NETWORK): flags global bypasses such as NSAllowsArbitraryLoads, WebView exceptions like NSAllowsArbitraryLoadsInWebContent, and per-domain NSExceptionAllowsInsecureHTTPLoads overrides in Info.plist.
  • Entitlements and Keychain access groups (MASVS-STORAGE, MASVS-PLATFORM): reviews keychain-access-groups, App Groups, iCloud containers, and get-task-allow to spot overly broad data sharing or debug capabilities left in release builds.
  • URL schemes and associated domains (MASVS-PLATFORM): inventories custom CFBundleURLTypes schemes and applinks: entries in com.apple.developer.associated-domains, which accept external input from browsers and other apps.
  • Embedded secrets and backend endpoints (MASVS-STORAGE, MASVS-CRYPTO): surfaces hardcoded tokens, staging URLs, API keys, and weak cryptographic primitive references across Mach-O strings and bundled plist or JSON resources.
  • Third-party frameworks and privacy manifests (MASVS-CODE, MASVS-PRIVACY): enumerates embedded frameworks, binary hardening flags, and PrivacyInfo.xcprivacy declarations for analytics and SDK dependencies.

Treat static IPA output as structured candidates for a human validator. A static ATS flag or embedded key shows what is present in the package, not whether sensitive tokens actually cross cleartext HTTP or grant privileged API access at runtime.

What a real iOS device run adds — and what re-signing does not prove

Pairing static IPA analysis with an authorized real-device run on a real iOS device confirms practical runtime facts that static unpacking cannot establish: the unencrypted IPA installs cleanly onto physical iOS hardware and reaches foreground launch without an immediate startup crash or missing-framework abort.

Important re-signing boundary: On the AWS Device Farm public iPhone pool, AWS re-signs the uploaded IPA with an AWS provisioning profile so the package can install on the booked device. Because the app is re-signed for the public pool, the device run does not verify the original App Store or distribution signature and does not prove effective production entitlements such as production Keychain sharing groups, push entitlements, or Associated Domains tied to your Apple Developer team ID.

The public iPhone path also does not perform full runtime instrumentation (such as Frida hooking or automated proxy decryption of TLS traffic). Dynamic coverage on that path is therefore explicitly reported as partial, and any static candidate — such as a global ATS exception — remains a candidate for human review until verified against the app's live network behavior under a signed scope.

Inspecting real evidence and CI integration

Before configuring your own iOS pipeline, download the redacted 6-page real iOS device reference report (public-iphone.pdf) on our sample reports page. It demonstrates how an unencrypted iOS test build combines OWASP MASVS static candidates with foreground-launch verification on physical hardware while disclosing test-build re-signing explicitly on page 4.

Because App Store downloads are FairPlay-encrypted, uploading your unencrypted development or ad-hoc IPA directly from CI is the most reliable workflow. See CI/CD integration to run scans under a signed scope and export SARIF with --allow-partial so candidate findings surface as non-blocking code-scanning notes. Review scan profiles for supported iOS artifacts and pricing and pilots to compare EU static-only scans, on-demand real-device pilots, and dedicated private-device reviews.

Related reading