M9: Insecure Mobile Data Storage
A second-hand tablet still held a working session.
What Is M9: Insecure Mobile Data Storage?
A mobile app that keeps tokens and personal data in plain files hands them to whoever holds the device next. You'll watch an attacker read a session off an unwiped second-hand tablet and use it, then revoke the device's tokens, move the session into hardware-backed storage and stop storing the most dangerous data at all.
What You'll Learn in M9: Insecure Mobile Data Storage
- Recognise that plain files and preferences on a device can be read by anyone who gets the device or its backups.
- Revoke tokens tied to a lost or resold device as soon as the exposure is known.
- Store session tokens and keys in hardware-backed storage such as the Keychain or Android Keystore.
- Avoid storing the most sensitive data on the device at all when the app can fetch it when needed.
M9: Insecure Mobile Data Storage — Training Steps
-
A tablet with someone's work on it
Quillmoor is a home-care company. Its carers visit clients at home and use the Quillmoor Visits app for their day's rota. Bob bought a cheap second-hand tablet online. The seller said it was 'returned by a contractor'. It was never wiped, the Quillmoor app is still on it, and its firmware lets the debug bridge run as root. Bob connects it to his laptop.
-
Read it
Android apps often keep small settings in a file called shared preferences. Bob opens the one he copied.
-
Swap the token for a session
A refresh token is worth more than the cached list: it asks the server for a fresh access token, as the carer the tablet belonged to.
-
Today's rota, live
Bob asks for what the app shows a carer each morning.
-
Where the session came from
-
A message from Nkechi
Before the details land in her inbox, Nkechi Adeyemi messages Alice directly.
-
A tablet that never came back
Alice leads the Quillmoor Visits apps. The operations manager has written to her.
-
Cut the tablet off
Before anything else, the token on that tablet must stop working. Alice revokes every refresh token issued to the device.
-
Look where the app keeps it
Alice wants to see exactly what an unwiped tablet gives away. Her test phone runs a debug build, so she can read the app's private files without root.
-
Open the session store
Alice opens the code that saves the session after sign-in.
Security Framework Coverage
OWASP Mobile Top 10
- M9:2024 Insecure Data Storage
OWASP MASVS
- MASVS-STORAGE-1 The app securely stores sensitive data.
CWE
- CWE-312 Cleartext Storage of Sensitive Information
MITRE ATT&CK
- T1409 Stored Application Data
CIS Controls
- CIS 16 Application Software Security
NIST CSF
- PR.AT-02 Individuals in specialized roles are provided with awareness and training so that they possess the knowledge and skills to perform relevant tasks with cybersecurity risks in mind
- PR.PS Platform Security
NICE Framework
- DD-WRL-003 Secure Software Development