|
1 | 1 | # MASVS-RESILIENCE: Resilience Against Reverse Engineering and Tampering |
2 | 2 |
|
3 | | -Defense-in-depth measures such as code obfuscation, anti-debugging, anti-tampering, etc. are important to increase app resilience against reverse engineering and specific client-side attacks. They add multiple layers of security controls to the app, making it more difficult for attackers to successfully reverse engineer and extract valuable intellectual property or sensitive data from it, which could result in: |
| 3 | +Defense-in-depth measures such as code obfuscation, anti-debugging, anti-tampering, and runtime application self-protection (RASP) can increase an app's resilience against reverse engineering and specific client-side attacks. They add multiple layers of security controls to the app, making it more difficult for attackers to modify code or extract sensitive information. |
4 | 4 |
|
5 | | -- The theft or compromise of valuable business assets such as proprietary algorithms, trade secrets, or customer data |
6 | | -- Significant financial losses due to loss of revenue or legal action |
7 | | -- Legal and reputational damage due to breach of contracts or regulations |
| 5 | +**The absence of these measures does not in itself constitute a vulnerability**. Instead, resilience controls provide additional protection against threat-specific attacks. **All apps must also fulfill the rest of the OWASP MASVS** controls according to their threat model. |
| 6 | + |
| 7 | +## Business and Commercial Perspective |
| 8 | + |
| 9 | +Resilience measures are particularly relevant when the app needs to protect business assets or deter client-side abuse. They can help mitigate risks such as: |
| 10 | + |
| 11 | +- Theft or compromise of proprietary algorithms, trade secrets, customer data, AI or machine learning models |
| 12 | +- Fraud, cheating, or revenue leakage in online games, financial apps, or subscription models |
| 13 | +- Legal and reputational damage due to breach of contracts or regulations |
8 | 14 | - Damage to brand reputation due to negative publicity or customer dissatisfaction |
9 | 15 |
|
10 | | -The controls in this category aim to ensure that the app is running on a trusted platform, prevent tampering at runtime and ensure the integrity of the app's intended functionality. Additionally, the controls impede comprehension by making it difficult to figure out how the app works using static analysis and prevent dynamic analysis and instrumentation that could allow an attacker to modify the code at runtime. |
| 16 | +These controls aim to ensure the app is running on a trusted platform, detect or prevent tampering at runtime, and preserve the integrity of the app's intended functionality. |
| 17 | + |
| 18 | +## Transparency and Open Audit Perspective |
| 19 | + |
| 20 | +In some contexts, such as government, health, or other public-interest apps, resilience measures may not be ideal due to multiple reasons: |
| 21 | + |
| 22 | +- It reduces transparency of what the compiled application is doing |
| 23 | +- Independent verification of the compiled application is more difficult |
| 24 | +- The diversity of smartphone operating systems can lead to false positives, potentially excluding legitimate users |
| 25 | + |
| 26 | +In case these concerns are valid for the target application, we recommend applying the following principles: |
| 27 | + |
| 28 | +- Open source distribution of source code for independent audits |
| 29 | +- Security must rely on verifiable design, strong cryptography, and server-side validation |
| 30 | +- Anti-tampering or obfuscation techniques must not be used as a substitute for proper security architecture |
| 31 | +- Controls should prevent cheating or malicious modification without hindering legitimate users and legitimate analysis or oversight |
| 32 | + |
| 33 | +## Platform Lock-in |
| 34 | + |
| 35 | +Runtime resilience controls focus on two things: |
| 36 | + |
| 37 | +- The application and its own memory and files |
| 38 | +- The underlying OS |
| 39 | + |
| 40 | +While verifying the integrity of the application itself is typically OS-agnostic, the same cannot be said for verifying the underlying OS. For example, while there is an open-source version of Android (AOSP), this is typically not the OS that is installed on consumer devices. Instead, many different flavors are developed with small differences in feature sets and security controls. Some examples include Google Android, HarmonyOS, FireOS, LineageOS, /e/OS, etc. By implementing flavor-specific detection mechanisms, the application may not function on any other flavor of Android. This results in a platform lock-in, possibly excluding legitimate users from using the application. |
| 41 | + |
| 42 | +Additionally, reliance on platform services such as Google Play Integrity API or Apple's App Attestation may further reinforce lock-in and limit accessibility for certain user groups. |
| 43 | + |
| 44 | +## Malware and Testing Perspective |
| 45 | + |
| 46 | +Resilience techniques can also be abused by malicious software. Malware authors often use code obfuscation, anti-debugging, and anti-tampering to: |
| 47 | + |
| 48 | +- Conceal malicious functionality |
| 49 | +- Evade security tools or app store review |
| 50 | +- Frustrate researchers and hinder forensic analysis |
11 | 51 |
|
12 | | -Note, however, that **the absence of any of these measures does not necessarily cause vulnerabilities** - instead, they provide additional threat-specific protection. **All apps must also fulfill the rest of the OWASP MASVS** security controls according to their specific threat models. |
| 52 | +For this reason, security testers must understand these techniques, know how to detect them, and practice bypassing them. This ensures that security assessments remain effective, and that defensive controls are distinguished from attempts to conceal harmful behavior. |
0 commit comments