This presentation covers OWASP Mobile Top 10 2014 risk M2, Insecure Data Storage, explaining how mobile applications on both Android and iOS frequently store sensitive data in plaintext or trivially reversible formats. Using real-world examples including Google Authenticator and Microsoft Outlook, the deck shows how insecure storage practices lead to identity theft, fraud, and compliance violations, and provides practical guidance on detection and mitigation.
Summary
The deck opened with mobile storage architecture. On Android, application-specific data lives under /data/data/<app>, a section only the application and root can access, while /sdcard/ is external memory, generally FAT32 with no ACL, readable by all applications and externally by a card reader. On iOS, <Application_Home>/Documents/ is accessible only to the app and the root user, and there is no SD card equivalent.
Insecure data storage was defined as what happens when development teams assume users or malware will never access the device filesystem, and store sensitive information such as PII in data-stores in insecure formats: plain text or trivially reversible encodings like double ROT-13, ROT-n, or base64/32/128. The consequences run from identity theft, fraud, and reputation damage to external policy violations such as PCI, or material loss. The demo section showed Approtect and Google Authenticator, whose plaintext secret keys database was documented in a public issue tracker, and Microsoft Outlook for mobile, whose accessible email storage was documented by INCLUDE Security.
Detection focused on the formats data takes on the device: XML, Plist, SQLite databases, plain text config files, log files, and cookies stored by WebView components. The Android method: install the app, configure and run it for some time, extract /data/data/<app_name>, observe the change in /sdcard before and after installation, then identify files and their content for sensitive data. Mitigation closed the deck: don’t store data unless absolutely necessary, never store credentials on the phone file system, force authentication over HTTPS on each app opening with session timeouts at the bare minimum the user experience allows, use SQLCipher for SQLite encryption, be aware that NSManagedObjects write to an unencrypted database file, keep shared preferences out of MODE_WORLD_READABLE, keep PII off the SDCARD, avoid NSUserDefaults for sensitive values, and remember that Apple or Android keychains become readable once a device is jailbroken or rooted.
Key Themes
- Mobile storage architecture: Android stores app data under
/data/data/<app> (app and root only) and on /sdcard/ (FAT32 external storage with no ACL, readable by all apps and card readers). iOS uses <Application_Home>/Documents/ (app and root only) with no SD card equivalent.
- What constitutes insecure data storage: Storing sensitive information such as PII in plain text or trivially reversible encodings (ROT-13 variants, base64/32/128) because development teams assume nobody will access the device filesystem. The problem spans databases, config files, logs, and cached data.
- Real-world impact: Identity theft, fraud, reputation damage, external policy violations such as PCI-DSS, and material loss.
- Demonstrated vulnerabilities: Google Authenticator stored its secret keys database in plaintext, and Microsoft Outlook for mobile stored email data in an accessible format, both documented by security researchers.
- Common storage formats to inspect: XML files, Plist files, SQLite databases, plain text configuration files, log files, and WebView cookies.
- Detection methodology for Android: Install the app, configure and run it, extract
/data/data/<app_name>, compare /sdcard/ before and after installation, and inspect file contents for exposure.
- Mitigation strategies: Minimize what is stored, never store credentials locally, force HTTPS re-authentication with minimal session timeouts, encrypt SQLite with SQLCipher, restrict shared preferences and SD card use, avoid NSUserDefaults on iOS, and treat keychains as readable once a device is jailbroken or rooted.
Notable Points
- Never store credentials, tokens, or PII on the mobile device filesystem in plaintext or trivially reversible formats; use platform-provided secure storage with proper encryption.
- When auditing an Android app, extract and inspect
/data/data/<app_name> and /sdcard/ for sensitive data in XML, SQLite, plist, config, or log files.
- Use SQLCipher for SQLite encryption and avoid
MODE_WORLD_READABLE shared preferences on Android.
- On iOS, avoid
NSUserDefaults for sensitive data, and know that NSManagedObject data lands in an unencrypted database file by default.
- Treat device keychains as defense in depth rather than a complete solution: they become readable on rooted or jailbroken devices.
- Force the user to authenticate over HTTPS on each app launch, with session timeouts set at the bare minimum the user experience requirements allow.
Notable Quotes
“It occurs when development teams assume that users or malware will not have access to a mobile device’s filesystem.”
“Never store credentials on the phone file system”
“donβt store data unless absolutely necessary”
“Apple or android keychains can be used but once jailbroken or rooted it can be easily read.”
“Ensure SDCARD storage is not used for PII or sensitive information of any sorts”