medium · M9 · MASVS-STORAGE-2 · PTKD-STO-BACKUP
Application data is backed up
android:allowBackup="true" lets app data be extracted via adb backup on many devices.
How it is exploited
With allowBackup enabled, adb backup (or a desktop "phone manager") exports the app's private data without root: databases, shared prefs, tokens. Cloud backups can also carry secrets off-device.
Why it matters
Anyone with brief USB access to an unlocked device walks away with the app's private storage.
How to fix it
- Set android:allowBackup="false", or define android:fullBackupContent / dataExtractionRules that exclude secrets.
- Keep tokens in Keystore-backed storage, which never enters backups.
Scoped backup rules (Android 12+)
<data-extraction-rules>
<cloud-backup><exclude domain="sharedpref" path="auth.xml"/></cloud-backup>
<device-transfer><exclude domain="sharedpref" path="auth.xml"/></device-transfer>
</data-extraction-rules>Does your app have this?
PTKD checks your build or your source project for PTKD-STO-BACKUP and every other check in this knowledge base.
Scan your appReferences
Related checks (M9)
- Android file or preferences created world-readable or world-writable
- Public Supabase bucket can be listed by anyone
- Public Supabase storage bucket (heuristic)
- Sensitive data written to external storage
- Sensitive data written to the log
- Secret written to device storage
- Tokens or passwords stored in plain app preferences
- Keychain item accessible while locked