M10: Insufficient Cryptography in Mobile Apps
The backups were encrypted with a key every copy of the app shared.
What Is M10: Insufficient Cryptography in Mobile Apps?
Encryption with a key built into the app, in a mode that leaks patterns, looks safe and protects nothing. You'll watch an attacker open exported journal backups with the app's own key, then shut the export path, move to AES-GCM with a key from the user's own passphrase and prove the old key no longer works.
What You'll Learn in M10: Insufficient Cryptography in Mobile Apps
- Explain why a key embedded in the app decrypts every user's data for anyone who extracts it.
- Recognise weak choices such as ECB mode, which reveals patterns, and encryption without integrity checks.
- Use authenticated encryption such as AES-GCM with a fresh nonce and a key derived from a secret only the user holds.
- Prove the fix by showing that data encrypted the new way cannot be opened with the old key.
M10: Insufficient Cryptography in Mobile Apps — Training Steps
-
Backups in the open
Tallowen is a private journaling app. Many people use it to keep notes between therapy sessions. A user can export the journal as an encrypted backup file and share it with a link, so they can move it to a new phone. Bob has noticed that those share links point at one storage folder, and that the folder lists its own contents.
-
A pattern in the noise
Bob downloads one backup and looks at its raw bytes. Good ciphertext looks like random noise from start to finish.
-
The key ships with the app
ECB alone would leak patterns. To read the entries Bob needs the key, so he looks in the place it should never be: the app itself. He has already decompiled the Android build.
-
Every entry, readable
Bob decrypts the backup with the key from the app.
-
Encrypted, but not protected
-
My journal is on a forum
Alice leads the Tallowen app team. Support has forwarded a message from a user.
-
Check the claim
Alice takes a backup from her own test account and tries the key that is compiled into the app.
-
Stop the bleeding
Old backups cannot be re-encrypted from the server: they are already out in the world. What Alice can do now is stop new ones and pull the public links.
-
Open the backup code
Now the cause. Alice opens the code that encrypts a backup.
-
Two mistakes in four lines
The algorithm is right. The key and the mode are wrong.
Security Framework Coverage
OWASP Mobile Top 10
- M10:2024 Insufficient Cryptography
OWASP MASVS
- MASVS-CRYPTO-1 The app employs current strong cryptography and uses it according to industry best practices.
- MASVS-CRYPTO-2 The app performs key management according to industry best practices.
CWE
- CWE-327 Use of a Broken or Risky Cryptographic Algorithm
- CWE-321 Use of Hard-coded Cryptographic Key
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