M7—Insufficient Binary Protections
>Control Description
**Application Specific**
Attackers who target app binaries are motivated by various reasons.
The binary could contain valuable secrets, such as commercial API keys or hardcoded cryptographic secrets that an attacker could misuse. In addition, the code in the binary could be valuable on its own, for example, because it contains critical business logic or pre-trained AI models. Some attackers might also not target the app itself but use it to explore potential weaknesses of the corresponding backend to prepare for an attack.
Besides collecting information, attackers could also manipulate app binaries to access paid features for free or to bypass other security checks. In the worst case, popular apps could be modified to contain malicious code and be distributed via third-party app stores or under a new name to exploit unsuspecting users. One common attack example is reconfiguring the payment identifiers in an app, repackaging it, and distributing it via app stores. Then, when users download this unauthorized copy from the app store, the attacker receives the payments instead of the original provider.
>Prevention & Mitigation Strategies
- 1.Apply obfuscation to the app binary using free or commercial obfuscation tools to make reverse engineering significantly harder.
- 2.Compile sensitive parts of apps natively (iOS and Android) or use interpreters/nested virtual machines to resist decompilation.
- 3.Enforce critical security checks on both the client and the backend; never rely solely on local security checks that can be bypassed.
- 4.Implement runtime integrity checks to detect code tampering and binary modification, rendering tampered installations unusable.
- 5.Implement mechanisms to detect redistribution of modified app binaries and automatically report unauthorized copies for removal from app stores.
- 6.Avoid hardcoding secrets (API keys, cryptographic keys, AI models) in the binary; retrieve them securely from a server at runtime when possible.
>Attack Scenarios
#1
#2
#3
>References
Ask AI
Configure your API key to use AI features.