Most mobile data exposure is not a deliberate write but a side effect: a token in a backup, a log line, a cached response or an app-switcher snapshot. Each of these copies sits outside the protections chosen for the primary store.
- Exclude sensitive files and preferences from cloud backup and device transfer (
dataExtractionRulesandfullBackupContenton Android,isExcludedFromBackupandThisDeviceOnlyitems on iOS). - Strip or redact sensitive values from logs in release builds.
- Hide sensitive screens from snapshots and screenshots, and keep secrets off the general clipboard.
- Clear caches of authenticated responses when the session ends.
MASTG tests in the local projects
The local projects run these OWASP MASTG v2.0.0 tests for MASVS-STORAGE-2, as tests you can repeat on your own machine.
| MASTG test | Platform | Project |
|---|---|---|
| MASTG-TEST-0215: Sensitive Data Not Marked For Backup Exclusion | iOS | Keep an iOS app's storage, links and web bridge in bounds · StorageTests |
| MASTG-TEST-0262: References to Backup Configurations Not Excluding Sensitive Data | Android | Repair an Android app's links, components, network policy and storage · StorageTests |
Guides on this site
Harden an iOS app's storage, network and entry points
Store secrets in the Keychain with the narrowest accessibility class, set file protection explicitly, keep App Transport Security on, prefer universal links, constrain WKWebView bridges, keep step-up keys in the Secure Enclave, verify App Attest on the server and ship an accurate privacy manifest, mapped to OWASP MASVS 2.1.
Harden an Android app's storage, network and entry points
Encrypt local secrets with Android Keystore keys now that Jetpack Security is deprecated, set transport policy in Network Security Configuration, close exported components and mutable PendingIntents, confine WebViews, verify App Links and judge Play Integrity verdicts on the server, mapped to OWASP MASVS 2.1.
Review mobile storage, links and platform permissions
Keep local artifacts and platform entry points from exposing authority that belongs on the server.
Practice
- Keep an iOS app's storage, links and web bridge in bounds · Local project
- Repair an Android app's links, components, network policy and storage · Local project
References
List data from the publisher. A guide is listed as the main subject when the weakness or risk is what the guide is about, and as covering it when a dedicated section or worked example addresses it.
Control statements are quoted from OWASP MASVS v2.1.0, licensed CC BY-SA 4.0; the rest is this site's summary. MASTG tests are those the iOS and Android projects here run, with their titles from mas.owasp.org. License.