iOS
Decrypted / unencrypted main binaryApp tamper
Inspects the Mach-O encryption load command to tell whether the executable is still FairPlay-encrypted. Opt-in.
At a glance
- Platform
- iOS
- Category
- App tamper
- Source
- DITamperChecks.m · isMainExecutableDecryptedOrMissingEncryption
- Default status
- Makes status compromised
- Seen firing
- Not yet seen firing in a validated run. Based on validated scenarios whose observed result includes this signal; see below.
- OWASP MASTG
- MASTG-TEST-0090, MASTG-TEST-0091
How it works
What the code inspects.
Finds the main executable's Mach-O header, walks its load commands, and reads LC_ENCRYPTION_INFO / LC_ENCRYPTION_INFO_64. A cryptid of 0 — or the absence of the command entirely — means the binary is not encrypted.
App Store / TestFlight builds ship FairPlay-encrypted (cryptid != 0). A cryptid of 0 at runtime means the binary was decrypted and rewritten, or was never a store build.
Opt-in via ios.requireEncryptedBinary; intended for App Store / TestFlight distribution. Skipped on the Simulator.
The exploit it addresses
Why this matters.The threat.
Reverse engineers 'decrypt' an App Store binary by dumping it from memory after FairPlay decrypts it (e.g. frida-ios-dump), then re-sign and redistribute a cracked, patched, or trojanized copy. An unencrypted main binary at runtime is strong evidence of exactly that pipeline.
How it can be bypassed
No single check is sufficient.Known evasions.
An attacker can patch the cryptid byte back to a non-zero value after dumping, so the check sees a value that claims encryption even though the payload is plaintext.
Enterprise / ad-hoc / development builds are legitimately unencrypted, so this check is only meaningful for store distribution and will false-positive otherwise.
Validation scenarios
Where this check is exercised.1 scenario.
References & further reading
- MASTG-TEST-0090: Testing File Integrity Checks (iOS)Open ↗
https://mas.owasp.org/MASTG/tests/ios/MASVS-RESILIENCE/MASTG-TEST-0090/
- mach-o/loader.h (LC_ENCRYPTION_INFO structures)Open ↗
https://github.com/apple-oss-distributions/xnu/blob/main/EXTERNAL_HEADERS/mach-o/loader.h
- frida-ios-dump (decrypt App Store binaries at runtime)Open ↗
https://github.com/AloneMonkey/frida-ios-dump
- OWASP Mobile Top 10 — M7: Insufficient Binary ProtectionOpen ↗
https://owasp.org/www-project-mobile-top-10/2023-risks/m7-insufficient-binary-protection
- TrollStore (permanent arbitrary signing via CoreTrust bug)Open ↗
https://github.com/opa334/TrollStore