📋 What Is It?
Reverse Engineering is the analysis of a shipped application binary to understand how it works from the inside. An attacker who never saw your source takes the .apk, .aab, or .ipa you published and recovers source-equivalent code, strings, resources, algorithms, keys, endpoints, and business logic. The app you distribute is the documentation of how it works - reverse engineering is just reading it.
This is not an exotic exploit; it is the default state of any binary shipped to a device you do not control. The core truth of M9: any secret, key, algorithm, or logic inside the client can be recovered. Obfuscation raises the cost and time of that recovery - it never makes it impossible. The only reliable protection for a secret is not putting it in the client at all.
⚠️ Common Exploits
- Decompilation: Dalvik/ART bytecode back to readable Java/Kotlin
- Native Disassembly:
.so/dylib decompiled to C-like pseudo-code - String Mining: API keys, URLs, feature flags, and messages pulled from resources
- Endpoint Mapping: the full back-end attack surface, including "hidden" routes
- Algorithm Recovery: signing, DRM, and anti-fraud logic understood then reimplemented
- Runtime Introspection: hooking to read values that are only assembled in memory
- Clone Building: a functional third-party client that speaks your API
🔴 Attack Flow
↓
2. Unpack resources and decompile bytecode; disassemble native libraries
↓
3. Grep for keys, endpoints, and interesting identifiers
↓
4. Hook the running app to fill in whatever static analysis missed
↓
5. IMPACT: Secrets recovered, logic understood, API abused directly!
❌ Vulnerable Code
✅ Secure Code
✓ Prevention Checklist
- Assume the binary is fully readable - design as if the source were published
- Ship no API keys, signing secrets, or credentials in the app
- Keep proprietary algorithms and risk logic on the server
- Issue short-lived, user-scoped, revocable tokens instead of static keys
- Proxy third-party APIs through your own back end
- Restrict any key that must ship (package name, signing certificate, referrer, scope)
- Enable R8/ProGuard shrinking and obfuscation on release builds
- Strip symbols and disable debugging in release artifacts
- Scan built artifacts for secrets in CI, before publishing
- Rotate any credential that ever shipped in a client
- Assume every endpoint the app can reach will be called directly - secure it accordingly
🔍 Detection & Tools
Analysis (use it on yourself):
Hardening & Scanning:
How to Test:
- Decompile your own release build and read it as an attacker would
- Grep strings and resources for keys, tokens, and internal hostnames
- Check whether class and method names survived obfuscation
- Hook the app and dump values assembled at runtime
- Call every discovered endpoint directly, without the app
🌍 Real-World
These are documented incident classes - recurring patterns rather than single CVEs.
- Cloud keys extracted from apps: long-lived provider credentials found in shipped binaries and used to access back-end storage directly.
- Internal endpoints discovered: "hidden" admin or partner hosts named in the client and then attacked directly.
- Anti-fraud logic reimplemented: client-side scoring recovered and replicated so an attacker can predict and avoid detection.
- Third-party clients: unofficial apps built by reverse-engineering the private API, bypassing rate limits and terms.
- Signing secrets recovered: HMAC keys in the binary let attackers forge requests that look authentic.
📌 Quick Tips
- DO NOT ship secrets in a mobile app
- DO NOT treat obfuscation as protection
- DO NOT assume compiled means private
- DO keep valuable logic on the server
- DO use short-lived, revocable tokens
- DO decompile your own build before shipping
📜 Compliance
Related Standards:
- OWASP Mobile Top 10 2016 - M9
- Maps to M7:2024 Insufficient Binary Protections
- OWASP MASVS RESILIENCE-1, RESILIENCE-3
- CWE-798 Use of Hard-coded Credentials
- CWE-656 Reliance on Security Through Obscurity
- CWE-1300 Improper Protection of Physical Side Channels (related resilience concerns)