TExcelTAD
Home › Wireless, IoT & Mobile Security › OWASP MASVS 2.x and the MASTG

OWASP MASVS 2.x and the MASTG

"Is our app secure?" has no answer until you say against what. For mobile apps the common answer is the OWASP Mobile Application Security project: the MASVS (Mobile Application Security Verification Standard) says what a secure app must do, the MASTG (Mobile Application Security Testing Guide) says how to test each requirement on Android and iOS, and the MASWE (Mobile Application Security Weakness Enumeration) catalogues the weaknesses in between. Security teams, app stores' review programmes and penetration-test contracts refer to them. This lesson walks through MASVS 2.x, the testing profiles, and maps a set of findings from this course to its controls.

From 1.x to 2.x

MASVS 1.x (until 2022) was a long list of requirements in three levels (L1, L2, R). Version 2.0 (2023) rewrote it as a short list of controls, each a statement of what the app achieves, grouped in control groups; the levels moved out of the standard into testing profiles that decide how deeply each control is tested. Version 2.1 (2024) added a privacy group. Control IDs look like MASVS-STORAGE-1.

Group What it covers Example controls (shortened)
MASVS-STORAGE data at rest 1 stores sensitive data securely; 2 prevents leakage (logs, backups, clipboard, screenshots)
MASVS-CRYPTO cryptography 1 uses current strong cryptography; 2 manages keys securely
MASVS-AUTH authentication and authorisation 1 secure protocols (backend-enforced); 2 local authentication; 3 step-up for sensitive operations
MASVS-NETWORK data in transit 1 secures all network traffic; 2 pins the identity of endpoints under the developer's control
MASVS-PLATFORM interaction with the OS and other apps 1 IPC (intents, providers, URL schemes); 2 WebViews; 3 the user interface
MASVS-CODE code quality and supply chain 1 requires an up-to-date platform; 2 update mechanism; 3 no known-vulnerable components; 4 validates untrusted input
MASVS-RESILIENCE resistance to reverse engineering and tampering 1 platform integrity; 2 anti-tampering; 3 anti-static analysis; 4 anti-dynamic analysis
MASVS-PRIVACY user privacy (2.1) 1 minimises data access; 2 prevents identification; 3 transparency; 4 user control

Testing profiles

Profile For Tests
MAS-L1 every app the baseline security tests
MAS-L2 apps handling sensitive data (banking, health, apps that control physical devices) L1 plus deeper tests, e.g. pinning, hardware-backed keys, step-up authentication
MAS-R apps that must resist reverse engineering and tampering (IP, anti-cheat, DRM) resilience tests, on top of L1 or L2
MAS-P privacy-focused testing the privacy controls

The LabHome app controls physical devices in people's homes, so L1 + L2 fits; R is optional, because resilience slows attackers but never replaces server-side checks.

The MASTG

The MASTG is the practical half: platform overviews, then for each control the tests (MASTG-TEST-…), techniques (how to decompile, how to intercept traffic, how to inspect storage) and tools, with Android and iOS variants. It also ships demo apps and test code. When a report says "MASTG-TEST-… failed", a reader can open that test and repeat it. The MASWE adds weakness IDs that link findings to controls, much as CWE does for general software (vulnerability assessment vocabulary).

Mapping findings to controls

The later lessons of this section build checkers for the manifest, the Info.plist, the code and the network setup. Their findings on the sample app (synthetic), mapped to MASVS:

python · try it yourself
MASVS = {  # MASVS 2.x control groups and controls (titles shortened)
    "STORAGE": {"1": "stores sensitive data securely", "2": "prevents leakage of sensitive data"},
    "CRYPTO": {"1": "uses current strong cryptography", "2": "manages keys securely"},
    "AUTH": {"1": "uses secure authentication and authorisation", "2": "local authentication done right",
             "3": "extra authentication for sensitive operations"},
    "NETWORK": {"1": "secures all network traffic", "2": "pins endpoints under the developer's control"},
    "PLATFORM": {"1": "uses IPC securely", "2": "uses WebViews securely", "3": "uses the UI securely"},
    "CODE": {"1": "requires an up-to-date platform", "2": "has an update mechanism", "3": "no known-vulnerable components",
             "4": "validates and sanitises untrusted input"},
    "RESILIENCE": {"1": "validates platform integrity", "2": "anti-tampering", "3": "anti-static analysis",
                   "4": "anti-dynamic analysis"},
    "PRIVACY": {"1": "minimises data access", "2": "prevents identification", "3": "is transparent",
                "4": "gives users control"},
}
findings = [  # findings from this course's checkers on the LabHome app (synthetic review)
    ("android:debuggable=\"true\" in the release build", "RESILIENCE-4", "high"),
    ("exported DeviceAdminActivity without permission", "PLATFORM-1", "high"),
    ("cleartext traffic allowed to api.lab.test", "NETWORK-1", "high"),
    ("session token in SharedPreferences, in backups", "STORAGE-1", "high"),
    ("token written to logcat", "STORAGE-2", "medium"),
    ("AES/ECB for the local cache", "CRYPTO-1", "medium"),
    ("API key hard-coded in the APK", "CRYPTO-2", "medium"),
    ("WebView with JavaScript bridge loading http:// help pages", "PLATFORM-2", "high"),
    ("READ_CONTACTS and RECORD_AUDIO without a feature", "PRIVACY-1", "medium"),
]
by_group = {g: [] for g in MASVS}
for text, ctrl, sev in findings:
    g, n = ctrl.split("-")
    assert n in MASVS[g], ctrl
    by_group[g].append((ctrl, sev, text))
for g, items in by_group.items():
    status = f"{len(items)} finding(s)" if items else "no findings (tested?)"
    print(f"MASVS-{g:10} {status}")
    for ctrl, sev, text in items:
        print(f"   {ctrl:13} {sev:6} {text}  [{MASVS[g][ctrl.split('-')[1]]}]")
MASVS-STORAGE    2 finding(s)
   STORAGE-1     high   session token in SharedPreferences, in backups  [stores sensitive data securely]
   STORAGE-2     medium token written to logcat  [prevents leakage of sensitive data]
MASVS-CRYPTO     2 finding(s)
   CRYPTO-1      medium AES/ECB for the local cache  [uses current strong cryptography]
   CRYPTO-2      medium API key hard-coded in the APK  [manages keys securely]
MASVS-AUTH       no findings (tested?)
MASVS-NETWORK    1 finding(s)
   NETWORK-1     high   cleartext traffic allowed to api.lab.test  [secures all network traffic]
MASVS-PLATFORM   2 finding(s)
   PLATFORM-1    high   exported DeviceAdminActivity without permission  [uses IPC securely]
   PLATFORM-2    high   WebView with JavaScript bridge loading http:// help pages  [uses WebViews securely]
MASVS-CODE       no findings (tested?)
MASVS-RESILIENCE 1 finding(s)
   RESILIENCE-4  high   android:debuggable="true" in the release build  [anti-dynamic analysis]
MASVS-PRIVACY    1 finding(s)
   PRIVACY-1     medium READ_CONTACTS and RECORD_AUDIO without a feature  [minimises data access]

The map does two jobs. It turns a list of findings into a report structure the app team and auditors know. And it shows gaps: AUTH and CODE have no findings, which means either the app is fine there or nobody tested; a review plan must say which. (AUTH in particular can't be judged from the app alone: authorisation lives on the backend.)

How MASVS is used well

  • Pick the profile first from the app's risk (data, money, physical effects), and put it in the contract or the release criteria.
  • Test every control in the profile, with MASTG tests as the method; record "not applicable" with a reason.
  • Map each finding to a control and a MASWE weakness; rate it with the project's risk method (CVSS).
  • Automate what can be automated (manifest and plist checks, secret scanning, dependency checks, static analysis such as MobSF) in CI, and keep manual testing for logic, authentication and the backend (mobile app testing).
  • Retest fixed findings against the same test.

How MASVS gaps are detected

  • Coverage tables like the one above, per release.
  • Release checklists that require a MASVS profile and a dated test report.
  • Pre-launch reports and store policy warnings (both stores flag cleartext traffic, outdated SDKs, risky permissions).

How it is fixed

The MASVS isn't fixed; apps are. Each finding's fix is in its own lesson: storage and crypto in Insecure Storage, Weak Crypto, WebViews and Hard-Coded Secrets, IPC and cleartext in Android Manifest Review and iOS Info.plist Review, network in Certificate Pinning.

Pitfalls

  • Citing MASVS 1.x requirement numbers in a 2.x report, or "L1/L2" as if they were still MASVS levels.
  • Treating RESILIENCE as a substitute for security: obfuscation slows reverse engineering, it doesn't protect a hard-coded key.
  • Scoping the test to the app and leaving out the API it talks to.

Practice

1. To which MASVS group does "the app accepts any TLS certificate" belong, and which control?

MASVS-NETWORK-1 (secures all network traffic): accepting any certificate disables TLS server authentication.

2. Add the finding "no update prompt for app versions with known vulnerabilities" to the program. Where does it go?

("no forced update for vulnerable versions", "CODE-2", "medium"): CODE-2 is the update mechanism. The CODE group then shows one finding.

3. A game studio wants MAS-R only, without L1. Why is that a poor choice?

Resilience controls make analysis harder but assume the baseline is in place. Without L1 the game may store tokens insecurely or skip TLS checks, which no obfuscation fixes. MAS-R is meant to be added on top of L1 or L2.

Test yourself

What changed in MASVS 2.0 compared with 1.x?

  1. It covers only Android
  2. Requirements became a short list of controls; levels moved into testing profiles
  3. It dropped cryptography
  4. It became a law

Which document tells you how to test a MASVS control on iOS?

  1. MASWE
  2. The MASTG
  3. The OWASP Top 10
  4. CVSS

Which group did MASVS 2.1 add?

  1. MASVS-NETWORK
  2. MASVS-PRIVACY
  3. MASVS-CRYPTO
  4. MASVS-AUTH

Why can't MASVS-AUTH be fully assessed from the app alone?

  1. It is optional
  2. Authorisation must be enforced on the backend, which the app test doesn't see
  3. It is only for iOS
  4. It has no controls