medium · M9 · MASVS-STORAGE-2 · PTKD-DYN-EXTERNAL-SENSITIVE
Sensitive data written to external storage
A file with sensitive-looking content/name was written to external (world-accessible) storage.
How it is exploited
Sensitive content landed on external/shared storage, which other apps can read (broadly on older Android, via media/documents APIs on newer). It also survives app uninstall.
Why it matters
Cross-app readable copies of private data, outside your app's sandbox and deletion lifecycle.
How to fix it
- Write private data to internal storage (Context.filesDir) or scoped app-specific external dirs.
- If exporting is a feature, encrypt the export or hand it off via the system share sheet instead of dropping files.
Does your app have this?
PTKD checks your build or your source project for PTKD-DYN-EXTERNAL-SENSITIVE 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 the log
- Secret written to device storage
- Tokens or passwords stored in plain app preferences
- Keychain item accessible while locked
- Tokens or passwords written to the device log