M10: Insufficient Cryptography (2024)
OWASP Risk Analysis
Use of weak, deprecated, or improperly implemented cryptographic algorithms. Includes poor key management, predictable IVs, and insecure random number generation.
Risk Assessment
Threat Agents
Threat agents include attackers targeting weak algorithms, malicious insiders manipulating processes or leaking keys, state-sponsored actors conducting cryptanalysis, cybercriminals stealing data or committing fraud, and those leveraging protocol vulnerabilities.
Attack Vectors
Exploitability
AVERAGE
Attackers exploit cryptographic vulnerabilities through cryptanalysis, brute force, or side-channel attacks against weak encryption algorithms, poor key management, or flawed implementations. Goals include decrypting data, unauthorized access, data breaches, and data forgery.
Security Weakness
Prevalence
COMMON
Detectability
AVERAGE
Weaknesses include using weak encryption algorithms, inadequate key lengths, poor key management, insecure random number generation, flawed cryptographic protocol implementation, vulnerable libraries, and weak hash functions.
Technical Impact
Impact
SEVERE
This vulnerability results in the unauthorized retrieval of sensitive information from the mobile device.
Business Impact
Impact
SEVERE
Data breaches exposing PII, financial details, or intellectual property with legal liability and regulatory penalties. Intellectual property loss through decrypted proprietary algorithms or trade secrets. Financial losses from fraud and unauthorized fund access.
Am I Vulnerable?
- Weak Encryption Algorithms: The mobile app may use encryption algorithms that are known to be weak or vulnerable to attacks. These algorithms may have known weaknesses, be outdated, or lack the necessary level of security to protect sensitive data effectively.
- Insufficient Key Length: Inadequate key length can weaken the encryption strength. If the mobile app uses short or easily guessable encryption keys, it becomes easier for attackers to decrypt the encrypted data through brute-force attacks.
- Improper Key Management: Poor key management practices, such as storing encryption keys insecurely or transmitting them in plain text, can expose the keys to unauthorized access.
- Flawed Encryption Implementation: The encryption/decryption process itself may be implemented incorrectly or contain programming flaws that can be exploited by attackers.
- Insecure Storage of Encryption Keys: If the encryption keys are stored insecurely on the mobile device, such as in plain text or in easily accessible locations, attackers can retrieve the keys and decrypt the protected data.
- Lack of Secure Transport Layer: If the mobile app fails to implement secure transport protocols, encrypted data may be vulnerable to interception or tampering during transmission over networks.
- Insufficient Validation and Authentication: Without proper validation and authentication of parties involved in encryption, attackers can impersonate legitimate entities, intercept encrypted data, and manipulate it.
- Lack of Salting: Salting, the process of adding random data to the input before hashing, is essential for enhancing the security of passwords. Without salting, password hashes are vulnerable to precomputed or brute-force attacks.
How Do I Prevent It?
- Use Strong Encryption Algorithms: Implement widely accepted and secure encryption algorithms, such as AES, RSA, or Elliptic Curve Cryptography (ECC).
- Ensure Sufficient Key Length: Select encryption keys with an appropriate length to ensure strong cryptographic strength. Follow industry recommendations for key sizes.
- Follow Secure Key Management Practices: Employ secure key management techniques, such as using key vaults or hardware security modules to securely store and manage encryption keys.
- Implement Encryption Correctly: Carefully implement encryption and decryption processes, adhering to established cryptographic libraries and frameworks to avoid introducing flaws.
- Secure Storage of Encryption Keys: Ensure encryption keys are securely stored on the mobile device. Avoid storing keys in plain text or easily accessible locations.
- Employ Secure Transport Layer: Use secure transport layer protocols, such as HTTPS, for transmitting encrypted data over networks. Validate certificates properly.
- Validate and Authenticate: Implement strong validation and authentication mechanisms to verify the integrity and authenticity of parties involved in encrypted communications.
- Regularly Update Security Measures: Keep the mobile application and underlying cryptographic components up to date with the latest security patches and updates.
- Conduct Security Testing: Perform thorough security testing, including cryptographic vulnerability assessments, penetration testing, and code reviews.
- Use Strong Hash Functions: Choose widely recognized and cryptographically secure hash functions like SHA-256 or bcrypt for hashing operations.
- Implement Salting: Always use a strong random salt when hashing passwords to prevent precomputed and rainbow table attacks.
- Use Key Derivation Functions: For password hashing, use Key Derivation Functions like PBKDF2, bcrypt, or scrypt to add computational cost and resist brute-force attacks.
Example Attack Scenarios
- Man-in-the-Middle (MitM) Attacks: An attacker intercepts the communication between the mobile application and the server. Weak cryptography can enable attackers to decrypt the intercepted data, modify it, and re-encrypt it before forwarding it to the intended recipient. This can lead to unauthorized access, data manipulation, or the injection of malicious content.
- Brute-Force Attacks: Attackers systematically try various combinations of keys until they find the correct one to decrypt the data. Weak cryptography can shorten the time required for such attacks, potentially exposing sensitive information.
- Cryptographic Downgrade Attacks: Mobile applications may support multiple encryption protocols or algorithms to establish secure connections. If weak cryptography is allowed as a fallback option, attackers can exploit this weakness and force the application to use weak encryption. As a result, they can decrypt the intercepted data more easily and launch subsequent attacks.
- Key Management Vulnerabilities: Weak key management practices can undermine the security of the cryptographic systems used in mobile applications. For example, if encryption keys are stored insecurely or are easily guessable, attackers can gain unauthorized access to the keys and decrypt the encrypted data. This can result in data breaches and privacy violations.
- Crypto Implementation Flaws: Weak cryptography can also stem from implementation flaws in the mobile application itself. These flaws may include incorrect usage of cryptographic libraries, insecure key generation, improper random number generation, or insecure handling of encryption-related functions. Attackers can exploit these flaws to bypass or weaken the encryption protections.
Based on OWASP Mobile Top 10 (2024) — the industry standard for mobile app security risks.