M10: Insufficient Cryptography in Mobile Apps

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

M10: Insufficient Cryptography in Mobile Apps — Training Steps

  1. 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.

  2. 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.

  3. 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.

  4. Every entry, readable

    Bob decrypts the backup with the key from the app.

  5. Encrypted, but not protected

  6. My journal is on a forum

    Alice leads the Tallowen app team. Support has forwarded a message from a user.

  7. Check the claim

    Alice takes a backup from her own test account and tries the key that is compiled into the app.

  8. 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.

  9. Open the backup code

    Now the cause. Alice opens the code that encrypts a backup.

  10. 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