Why it matters

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.

How to meet it

  • Exclude sensitive files and preferences from cloud backup and device transfer (dataExtractionRules and fullBackupContent on Android, isExcludedFromBackup and ThisDeviceOnly items 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 testPlatformProject
MASTG-TEST-0215: Sensitive Data Not Marked For Backup ExclusioniOSKeep an iOS app's storage, links and web bridge in bounds · StorageTests
MASTG-TEST-0262: References to Backup Configurations Not Excluding Sensitive DataAndroidRepair an Android app's links, components, network policy and storage · StorageTests

Guides on this site

Practice

References

  1. MASVS-STORAGE-2 (OWASP MASVS v2.1.0)
  2. MASVS-STORAGE: Storage (OWASP MASVS v2.1.0)

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.