This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org
Difference between revisions of "Top 10 2010-A7-Insecure Cryptographic Storage"
Line 2: | Line 2: | ||
<center> | <center> | ||
{| style="align:center; text-align:center; border:2px solid #4F81BD; background-color:#F2F2F2; padding=2;" | {| style="align:center; text-align:center; border:2px solid #4F81BD; background-color:#F2F2F2; padding=2;" | ||
− | |- style="background-color: #4F81Bd; color: # | + | |- style="background-color: #4F81Bd; color: #FFFFFF;" |
! Threat Agents !! Attack Vectors | ! Threat Agents !! Attack Vectors | ||
! colspan="2" | Security Weakness | ! colspan="2" | Security Weakness | ||
Line 8: | Line 8: | ||
! Business Impacts | ! Business Impacts | ||
|- | |- | ||
− | | style="background-color: #D9D9D9; color: # | + | | style="background-color: #D9D9D9; color: #000000;" | ______ |
− | | style="background-color: #FF0000; color: # | + | | style="background-color: #FF0000; color: #000000;" | Exploitability<br>EASY |
− | | style="background-color: #FFFF00; color: # | + | | style="background-color: #FFFF00; color: #000000;" | Prevalence<br>UNCOMMON |
− | | style="background-color: #FFB200; color: # | + | | style="background-color: #FFB200; color: #000000;" | Detectability<br>DIFFICULT |
− | | style="background-color: #FF0000; color: # | + | | style="background-color: #FF0000; color: #000000;" | Impact<br>SEVERE |
− | | style="background-color: #D9D9D9; color: # | + | | style="background-color: #D9D9D9; color: #000000;" | ______ |
|- | |- | ||
| style="text-align: left; border: 2px solid #FFFFFF;" | Consider the users of your system. Would they like to gain access to protected data they aren’t authorized for? What about internal administrators? | | style="text-align: left; border: 2px solid #FFFFFF;" | Consider the users of your system. Would they like to gain access to protected data they aren’t authorized for? What about internal administrators? |
Revision as of 20:04, 21 April 2010
NOTE: THIS IS NOT THE LATEST VERSION. Please visit the OWASP Top 10 project page to find the latest edition.
Threat Agents | Attack Vectors | Security Weakness | Technical Impact | Business Impacts | |
---|---|---|---|---|---|
______ | Exploitability EASY |
Prevalence UNCOMMON |
Detectability DIFFICULT |
Impact SEVERE |
______ |
Consider the users of your system. Would they like to gain access to protected data they aren’t authorized for? What about internal administrators? | Attackers typically don’t break the crypto. They break something else, such as find keys, get cleartext copies of data, or access data via channels that automatically decrypt. | The most common flaw in this area is simply not encrypting data that deserves encryption. When encryption is employed, unsafe key generation and storage, not rotating keys, and weak algorithm usage is common. Use of weak or unsalted hashes to protect passwords is also common. External attackers have difficulty detecting such flaws due to limited access. They usually must exploit something else first to gain the needed access. | Failure frequently compromises all data that should have been encrypted. Typically this information includes sensitive data such as health records, credentials, personal data, credit cards, etc. | Consider the business value of the lost data and impact to your reputation. What is your legal liability if this data is exposed? Also consider the damage to your reputation. |
Am I Vulnerable to Injection?
The first thing you have to determine is which data is sensitive enough to require encryption. For example, passwords, credit cards, health records, and personal information should be encrypted. For all such data, ensure:
- It is encrypted everywhere it is stored long term, particularly in backups of this data.
- Only authorized users can access decrypted copies of the data (i.e., access control – See A4 and A8).
- A strong standard encryption algorithm is used.
- A strong key is generated, protected from unauthorized access, and key change is planned for.
And more ... For a more complete set of problems to avoid, see the ASVS requirements on Cryptography (V7)
How Do I Prevent Injection?
The full perils of unsafe cryptography are well beyond the scope of this Top 10. That said, for all sensitive data deserving encryption, do all of the following, at a minimum:
- Considering the threats you plan to protect this data from (e.g., insider attack, external user), make sure you encrypt all such data at rest in a manner that defends against these threats.
- Ensure offsite backups are encrypted, but the keys are managed and backed up separately.
- Ensure appropriate strong standard algorithms and strong keys are used, and key management is in place.
- Ensure passwords are hashed with a strong standard algorithm and an appropriate salt is used.
- Ensure all keys and passwords are protected from unauthorized access.
Example Attack Scenarios
Scenario #: An application encrypts credit cards in a database to prevent exposure to end users. However, the database is set to automatically decrypt queries against the credit card columns, allowing a SQL injection flaw to retrieve all the credit cards in cleartext. The system should have been configured to allow only back end applications to decrypt them, not the front end web application.
Scenario #2: A backup tape is made of encrypted health records, but the encryption key is on the same backup. The tape never arrives at the backup center.
Scenario #3: The password database uses unsalted hashes to store everyone’s passwords. A file upload flaw allows an attacker to retrieve the password file. All the unsalted hashes can be brute forced in 4 weeks, while properly salted hashes would have taken over 3000 years.
References
OWASP For a more complete set of requirements and problems to avoid in this area, see the ASVS requirements on Cryptography (V7).
- OWASP Top 10-2007 on Insecure Cryptographic Storage
- ESAPI Encryptor API
- OWASP Development Guide: Chapter on Cryptography
- OWASP Code Review Guide: Chapter on Cryptography
External
- CWE Entry 310 on Cryptographic Issues
- CWE Entry 312 on Cleartext Storage of Sensitive Information
- CWE Entry 326 on Weak Encryption
![CC-by-sa-3 0-88x31.png](/images/6/64/CC-by-sa-3_0-88x31.png)