OWASP Top 10: Cryptographic Failures
Cryptographic failure vulnerabilities exist when a web application fails to use cryptography correctly. Some of the most common failures include:
In this article
- Not Using Cryptography: If a web application doesn’t encrypt sensitive information, this data may be leaked.
- Using Broken Cryptography: Some cryptographic algorithms, such as the Data Encryption Standard (DES) or the MD5 hash algorithm, are broken and should never be used for security purposes.
- Using Cryptography Incorrectly: A web application may incorrectly implement a cryptographic algorithm or use it for purposes other than what it is intended for.
- Failing to Verify: Failing to verify digital signatures could cause an application to trust data that was generated or manipulated by an attacker.
What is the Risk?
Cryptography is one of the fundamental tools used to achieve core security goals, such as data confidentiality, integrity, and authentication. Encryption algorithms protect sensitive data against exposure, while digital signatures prove that data is authentic and hasn’t been modified since the digital signature was generated.
If a web application fails to properly implement cryptography, these core protections could be undermined. One of the most likely impacts is a data breach if an attacker is able to gain access to sensitive information that is encrypted or protected by a broken or improperly implemented encryption algorithm. Similarly, several companies have suffered data breaches that included user passwords that weren’t protected in accordance with security best practices (e.g. salted and hashed with a secure hash algorithm).
Examples of Attack Scenarios
Traffic Sniffing
Several network protocols, such as FTP, HTTP, and Telnet are designed to transmit information in plaintext. This means that anyone with the ability to sniff the network traffic can read its contents, including potentially sensitive data such as user credentials.
If a web application is configured to perform sensitive operations over an insecure protocol like HTTP, an attacker may be able to monitor those communications en route to their destination. This could allow them to read or edit sensitive data within the traffic.
Exploiting Broken Algorithms
Some cryptographic algorithms, such as the MD5 hash function, are broken. This means that they shouldn’t be used for security-related purposes.
For example, if an organization uses MD5 to hash account passwords, it is easy for an attacker to find a password that has the same hash as the user’s real password. This would allow them to successfully authenticate as the user and gain access to their account.
Side Channel Attacks
Side channel attacks take advantage of inadvertent data leaks by a cryptographic algorithm, typically a custom implementation. One example of this is timing analysis, where the time that it takes a system to perform a cryptographic operation reveals information about the protected data.
An attacker can exploit this side channel leakage by interacting with the system multiple times and using the leaked information to work toward their goal. For example, they may be able to guess a password one character at a time if the system takes longer to reject a password with more correct characters than one that has fewer correct characters.
Case Study: Zerologon
Zerologon was a vulnerability in Microsoft’s Netlogon Remote Protocol that was discovered in 2020. This vulnerability allowed an unauthenticated attacker with network access to a vulnerable domain controller to achieve domain admin privileges, granting them complete control over the domain.
The root issue in this vulnerability was the use of an all-zero initialization vector (IV) in a custom implementation of AES-CFB8. The result of this is that an attacker could attempt to authenticate to the domain controller with an all-zero credential and have a 1/256 probability of success. With repeated attempts, they would eventually succeed and could reset the password for the domain controller.
How to Remediate Cryptographic Failures
Cryptographic failures can stem from a variety of different errors. Some best practices to avoid these include:
- Encrypt Sensitive Data: Data should be classified based on sensitivity, and all sensitive data should be encrypted both at rest and in transit. For example, a web application should be configured to only accept traffic via HTTPS.
- Use Secure Algorithms: Cryptography should only be implemented using secure, trusted algorithms. This involves both avoiding broken algorithms and not designing custom cryptographic algorithms.
- Use Standard Implementations: Even slight errors in implementing cryptography can undermine the protection that it provides. Whenever possible, use standardized implementations and libraries to protect against these vulnerabilities.
- Use Strong Source of Randomness: Some cryptographic algorithms, such as cryptographic keys and IVs, need to be randomly generated. These values should be generated using a cryptographic source of randomness that is unpredictable to an attacker.
How IONIX Can Help
The OWASP Top Ten details the most common and impactful vulnerabilities in web applications. As the second item on the list, Cryptographic Failures are common issues that carry significant potential risks.
IONIX helps organizations protect against Cryptographic Failures and other OWASP Top Ten vulnerabilities via proactive risk simulation. When performing a risk assessment, the IONIX platform attempts to detect and exploit these vulnerabilities, providing the insight required to close these security gaps before they can be exploited by an attacker. To learn more about how to address your OWASP and other security risks with IONIX, sign up for a free demo.