Mobile Threat Catalogue

Poorly Implemented Cryptography

Contribute

Threat Category: Vulnerable Applications

ID: APP-10

Threat Description: While still supported by many systems, cryptographic algorithms and ciphers proven to be weak or broken should not be used to protect sensitive data. Weak algorithm/ciphers are those that have been deprecated following advancements in processing speeds and distributed processessing that have made brute-force attacks against them feasible. Broken algorithms, such as MD5, have known vulnerabilities an attacker can exploit to defeat one or more of its security properties. Similarly, the use of novel (e.g. home-grown) cryptographic algorithms should also be avoided. Novel algorithms may not have yet undergone sufficient scrutiny by the cryptologic community at large, and may possess flaws that if discovered, present an attacker with a path of lesser resistance to achieving unauthorized access to any data these cryptographic mechanisms were designed to protect.

Threat Origin

OWASP Mobile Top 10 2016 1

Exploit Examples

FortiClient Multiple Vulnerabilities 2

CVE Examples

Possible Countermeasures

Mobile App Developer

Strictly avoid the use of hard-coded cryptographic keys in application source code.

Explicitly overwrite variables containing cryptographic keys or other secrets following each use to prevent unauthorized disclosure of the secret if that memory location is subsequently accessed by untrusted code.

Use each cryptographic key for a single purpose to limit the impact of key compromise.

Strictly avoid the use of ‘broken’, weak, or novel algorithms (those that have not undergone extensive evaluation by the cryptographic community at large) to protect long-term secrets.

Consider the use of cryptographic functions provided by the mobile operating system and where possible, leverage hardware-backed cryptographic and secure storage services.

Additionally, application developers are strongly encouraged to familiarize themselves with best practices for cryptography and general key management, and to integrate that knowledge early in the application design process. See NIST SP 800-57 Part 1 Revision 4, Recommendation for Key Management, Part 1 General3

For Android developers, review guidance on the proper use of the Android Keystore System.4

For iOS developers, review guidance on the proper use of the iOS Keychain.5

Enterprise

Use app vetting tools/services to detect the misuse of cryptography in mobile apps.

References

  1. Mobile Top 10 2016, Mar. 2016; www.owasp.org/index.php/Mobile_Top_10_2016-Top_10 [accessed 8/23/2016] 

  2. D. Andzakovic, FortiClient Multiple Vulnerabilities, vulnerability disclosure, 29 Jan. 2015; www.security-assessment.com/files/documents/advisory/Fortinet_FortiClient_Multiple_Vulnerabilities.pdf [accessed 8/25/2016] 

  3. “Keychain Services Programming Guide”, Apple, 2016; https://developer.apple.com/library/content/documentation/Security/Conceptual/keychainServConcepts/01introduction/introduction.html [accessed 10/14/2016] 

  4. “Android Keystore System”, https://developer.android.com/training/articles/keystore.html [accessed 10/14/2016] 

  5. E. Barker, Recommendation for Key Management: Part 1: General, NIST SP 800-574 pt. 1 rev. 4, National Institute of Standards and Technology, 2016; http://dx.doi.org/10.6028/NIST.SP.800-57pt1r4 [accessed 10/17/2016]