Find sensitive data stored insecurely on-device — plaintext credentials, tokens, PII in shared_prefs, SQLite databases, files, external storage, and cache — via run-as/root, sqlite3, strings, and objection. Tier 1. Use after exercising app features. Aligns to OWASP MASTG MASVS-STORAGE (MASTG-TEST-0001).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Android Insecure Storage?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anandjogawade-android-insecure-storage)
---
name: android-insecure-storage
description: Find sensitive data stored insecurely on-device — plaintext credentials, tokens, PII in shared_prefs, SQLite databases, files, external storage, and cache — via run-as/root, sqlite3, strings, and objection. Tier 1. Use after exercising app features. Aligns to OWASP MASTG MASVS-STORAGE (MASTG-TEST-0001).
---
# Android Insecure Data Storage
Trigger app features, then inspect every on-device storage location for plaintext secrets, tokens, and PII.
## Trigger phrases
`insecure storage, shared_prefs, sqlite, databases, external storage, sdcard, cache, run-as, objection explore, plaintext token on device`
## Method
1. **Exercise the app first** — log in, store a card, save notes, etc., so secrets are actually written.
2. **Enumerate storage locations:**
- `/data/data/<package>/shared_prefs/`, `/databases/`, `/files/`, `/cache/`
- `/sdcard/Android/data/<package>/` and `/sdcard/` (external — world-readable pre-scoped-storage).
3. **Inspect (root or debuggable app via `run-as`):**
- `adb shell run-as <package> cat shared_prefs/*.xml`
- `adb shell run-as <package> ls databases/`
- `adb pull /data/data/<package>/databases/app.db && sqlite3 app.db ".tables" ".dump"`
- `strings` over files/cache for residual secrets.
4. **objection** (no manual rooting of paths):
```
objection -g <package> explore
android > env # dumps app dirs
android > sqlite connect <db>
```
5. **Check insecure modes** — `MODE_WORLD_READABLE`/`MODE_WORLD_WRITABLE` (grep decompiled code for `openFileOutput(... MODE_WORLD`), and sensitive residue in external storage/cache.
## Modern / rare techniques
- **EncryptedSharedPreferences / SQLCipher key recovery** — if "encrypted" storage is used but the key is derived in-app or keystore auth isn't bound, dump the key at runtime with Frida (`android-frida-objection-instrumentation`) and decrypt the store.
- **Debuggable app = no root needed:** `android:debuggable="true"` lets `run-as` read private data on a stock device.
- **External/scoped-storage residue:** check media/`Downloads` and app cache for exported secrets even when internal storage is clean.
## Escalation / chaining
Plaintext tokens/session → account takeover (feed into `android-backend-api-testing`); encrypted-at-rest with recoverable key → `android-crypto-keystore`; combine with `android-backup-extraction` for a non-root path to the same data.
## Backend & tooling
Preferred Kali path (native Kali / WSL+Kali / Kali-SSH / Kali-MCP / HexStrike). Needs the user's rooted device/emulator (or debuggable app) + Kali tooling (adb/sqlite3/objection/strings). Windows-local last resort. See `zazy-orchestrator`.
## Verification (background, before reporting)
Reproduce the extraction independently (second pull, or a different storage path) and confirm the value is genuinely sensitive and live (e.g., the token still authenticates). Report true positives only.
## Evidence
The file/DB path, the plaintext secret (redacted), the insecure mode if any, and proof it is usable. Remediation: EncryptedSharedPreferences/SQLCipher with keystore-backed keys; keep sensitive data off external storage; clear cache; never world-readable modes.