Difference between revisions of "Top 10 2013-A6-Sensitive Data Exposure"

From OWASP
Jump to: navigation, search
m (deleted a '#' in at 'How Do I prevent...'; added < br/ > at 'References' (like at A2))
 
(8 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
     |next=A7-{{Top_10_2010:ByTheNumbers
 
     |next=A7-{{Top_10_2010:ByTheNumbers
 
               |7
 
               |7
               |year=2013}}
+
               |year=2013
 +
              |language=en}}
 
     |useprev=2013PrevLink
 
     |useprev=2013PrevLink
 
     |prev=A5-{{Top_10_2010:ByTheNumbers
 
     |prev=A5-{{Top_10_2010:ByTheNumbers
 
               |5
 
               |5
               |year=2013}}
+
               |year=2013
 +
              |language=en}}
 +
    |year=2013
 +
    |language=en
 
}}
 
}}
  
{{Top_10_2010:SummaryTableHeaderBeginTemplate}}
+
{{Top_10_2010:SummaryTableHeaderBeginTemplate|year=2013|language=en}}
{{Top_10_2010:SummaryTableValue-3-Template|Exploitability|DIFFICULT}}
+
  {{Top_10:SummaryTableTemplate|exploitability=3|prevalence=3|detectability=2|impact=1|year=2013|language=en}}
{{Top_10_2010:SummaryTableValue-3-Template|Prevalence|UNCOMMON}}
+
{{Top_10_2010:SummaryTableHeaderEndTemplate|year=2013}}
{{Top_10_2010:SummaryTableValue-2-Template|Detectability|AVERAGE}}
+
{{Top_10_2010:SummaryTableValue-1-Template|Impact|SEVERE}}
+
{{Top_10_2010:SummaryTableHeaderEndTemplate}}
+
 
     <td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}>Consider who can gain access to your sensitive data and any backups of that data. This includes the data at rest, in transit, and even in your customers’ browsers. Include both external and internal threats.
 
     <td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}>Consider who can gain access to your sensitive data and any backups of that data. This includes the data at rest, in transit, and even in your customers’ browsers. Include both external and internal threats.
.</td>
 
    <td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}>Attackers typically don’t break crypto directly. They break something else, such as steal keys, do a man-in-the-middle attack, steal clear text data off the server, steal it in transit, or right from the browser.
 
 
</td>
 
</td>
     <td colspan=2  {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}>The most common flaw is simply not encrypting sensitive data. When crypto is employed, weak key generation and management, and weak algorithm usage is common, particularly weak hashing solutions to protect passwords. Browser weaknesses are very common and easy to detect, but hard to exploit. External attackers have difficulty detecting most of these types of flaws due to limited access and they are also usually hard to exploit.  
+
     <td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}>
 +
Attackers typically don’t break crypto directly. They break something else, such as steal keys, do man-in-the-middle attacks, or steal clear text data off the server, while in transit, or from the user’s browser.
 +
 
 
</td>
 
</td>
     <td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}>Failure frequently compromises all data that should have been protected. Typically this information includes  sensitive data such as health records, credentials, personal data, credit cards, etc.
+
     <td colspan=2  {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}>
 +
The most common flaw is simply not encrypting sensitive data. When crypto is employed, weak key generation and management, and weak algorithm usage is common, particularly weak password hashing techniques. Browser weaknesses are very common and easy to detect, but hard to exploit on a large scale. External attackers have difficulty detecting server side flaws due to limited access and they are also usually hard to exploit.  
 +
 
 
</td>
 
</td>
     <td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}>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.
+
     <td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}>
 +
Failure frequently compromises all data that should have been protected. Typically, this information includes  sensitive data such as health records, credentials, personal data, credit cards, etc.
 +
 
 +
</td>
 +
    <td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}>
 +
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.
 +
 
 
</td>
 
</td>
 
{{Top_10_2010:SummaryTableEndTemplate}}
 
{{Top_10_2010:SummaryTableEndTemplate}}
  
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=1|risk=6|year=2013}}
+
{{Top_10:SubsectionTableBeginTemplate|type=main}} {{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|subsection=vulnerableTo|position=firstLeft|risk=6|year=2013|language=en}}
The first thing you have to determine is which data is sensitive enough to require extra protection. For example, passwords, credit card numbers, health records, and personal information should be protected. For all such data, ensure:
+
The first thing you have to determine is which data is sensitive enough to require extra protection. For example, passwords, credit card numbers, health records, and personal information should be protected. For all such data:
# It is encrypted everywhere it is stored long term, including backups of this data.
+
# Is any of this data stored in clear text long term, including backups of this data?
# It is encrypted in transit, ideally internally as well as externally. All internet traffic should be encrypted.
+
# Is any of this data transmitted in clear text, internally or externally? Internet traffic is especially dangerous.
# Strong encryption algorithms are used for all crypto.
+
# Are any old / weak cryptographic algorithms used?
# Strong crypto keys are generated, and proper key management is in place, including key rotation.
+
# Are weak crypto keys generated, or is proper key management or rotation missing?
# Proper browser directives and headers are set to protect sensitive data provided by or sent to the browser.
+
# Are any browser security directives or headers missing when sensitive data is provided by / sent to the browser?
And more ... For a more complete set of problems to avoid, see ASVS areas Crypto (V7), Data Prot. (V9), and SSL (V10)
+
 
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=2|risk=6|year=2013}}
+
And more For a more complete set of problems to avoid, see [https://www.owasp.org/index.php/ASVS  ASVS areas Crypto (V7), Data Prot. (V9), and SSL (V10)].
 +
 
 +
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|subsection=howPrevent|position=right|risk=6|year=2013|language=en}}
 
The full perils of unsafe cryptography, SSL usage, and data protection are well beyond the scope of the Top 10. That said, for all sensitive data, do all of the following, at a minimum:
 
The full perils of unsafe cryptography, SSL usage, and data protection are well beyond the scope of the Top 10. That said, for all sensitive data, 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 sensitive data at rest and in transit in a manner that defends against these threats.
 
# Considering the threats you plan to protect this data from (e.g., insider attack, external user), make sure you encrypt all sensitive data at rest and in transit in a manner that defends against these threats.
 
# Don’t store sensitive data unnecessarily. Discard it as soon as possible. Data you don’t have can’t be stolen.
 
# Don’t store sensitive data unnecessarily. Discard it as soon as possible. Data you don’t have can’t be stolen.
# Ensure strong standard algorithms and strong keys are used, and proper key management is in place.
+
# Ensure strong standard algorithms and strong keys are used, and proper key management is in place. Consider using [http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140val-all.htm  FIPS 140 validated cryptographic modules].
# Ensure passwords are stored with an algorithm specifically designed for password protection, such as bcrypt, PBKDF2, or scrypt.
+
# Ensure passwords are stored with an algorithm specifically designed for password protection, such as [http://en.wikipedia.org/wiki/Bcrypt  bcrypt], [http://en.wikipedia.org/wiki/PBKDF2 PBKDF2], or [http://en.wikipedia.org/wiki/Scrypt  scrypt].
# Disable autocomplete on forms collecting sensitive data and disable caching for pages displaying sensitive data.
+
# Disable autocomplete on forms collecting sensitive data and disable caching for pages that contain sensitive data.
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=3|risk=6|year=2013}}
+
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|subsection=example|position=left|risk=6|year=2013|language=en}}
<u>Scenario #1:</u> An application encrypts credit card numbers in a database using automatic database encryption. However, this means it also decrypts this data automatically when retrieved, allowing an SQL injection flaw to retrieve credit card numbers in clear text. The system should have encrypted the credit card numbers using a public key, and only allowed back-end applications to decrypt them with the private key.
+
'''Scenario #1:''' An application encrypts credit card numbers in a database using automatic database encryption. However, this means it also decrypts this data automatically when retrieved, allowing an SQL injection flaw to retrieve credit card numbers in clear text. The system should have encrypted the credit card numbers using a public key, and only allowed back-end applications to decrypt them with the private key.
<u>Scenario #2:</u> A site simply doesn’t use SSL for all authenticated pages. Attacker simply monitors network traffic (like an open wireless network), and steals the user’s session cookie. Attacker then replays this cookie and hijacks the user’s session, accessing all their private data.
+
 
<u>Scenario #3:</u> 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 exposed with a rainbow table of precalculated hashes.
+
'''Scenario #2:''' A site simply doesn’t use SSL for all authenticated pages. Attacker simply monitors network traffic (like an open wireless network), and steals the user’s session cookie. Attacker then replays this cookie and hijacks the user’s session, accessing the user’s private data.
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=4|risk=6|year=2013}}
+
 
{{Top_10_2010:SubSubsectionOWASPReferencesTemplate}}
+
'''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 of the unsalted hashes can be exposed with a rainbow table of precalculated hashes.
For a more complete set of requirements, see ASVS req’ts on Cryptography (V7), Data Protection (V9)  and Communications Security (V10)
+
 
* OWASP Cryptographic Storage Cheat Sheet
+
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|subsection=references|position=right|risk=6|year=2013|language=en}}
* OWASP Password Storage Cheat Sheet
+
{{Top_10_2010:SubSubsectionOWASPReferencesTemplate}} <br/>
* OWASP Transport Layer Protection Cheat Sheet
+
For a more complete set of requirements, see [https://www.owasp.org/index.php/ASVS  ASVS req’ts on Cryptography (V7), Data Protection (V9)] and [https://www.owasp.org/index.php/ASVS  Communications Security (V10)]
* OWASP Testing Guide: Chapter on SSL/TLS Testing
+
* [https://www.owasp.org/index.php/Cryptographic_Storage_Cheat_Sheet  OWASP Cryptographic Storage Cheat Sheet]
 +
* [https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet  OWASP Password Storage Cheat Sheet]
 +
* [https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet  OWASP Transport Layer Protection Cheat Sheet]
 +
* [https://www.owasp.org/index.php/Testing_for_SSL-TLS  OWASP Testing Guide: Chapter on SSL/TLS Testing]
 +
{{Top_10_2010:SubSubsectionExternalReferencesTemplate|language=en}}
 +
* [http://cwe.mitre.org/data/definitions/310.html  CWE Entry 310 on Cryptographic Issues]
 +
* [http://cwe.mitre.org/data/definitions/312.html  CWE Entry 312 on Cleartext Storage of Sensitive Information]
 +
* [http://cwe.mitre.org/data/definitions/319.html  CWE Entry 319 on Cleartext Transmission of Sensitive Information]
 +
* [http://cwe.mitre.org/data/definitions/326.html  CWE Entry 326 on Weak Encryption]
 +
 
  
{{Top_10_2010:SubSubsectionExternalReferencesTemplate}}
 
* CWE Entry 310 on Cryptographic Issues
 
* CWE Entry 312 on Cleartext Storage of Sensitive Information
 
* CWE Entry 319 on Cleartext Transmission of Sensitive Information
 
* CWE Entry 326 on Weak Encryption
 
  
 
{{Top_10_2013:BottomAdvancedTemplate
 
{{Top_10_2013:BottomAdvancedTemplate
Line 66: Line 81:
 
     |next=A7-{{Top_10_2010:ByTheNumbers
 
     |next=A7-{{Top_10_2010:ByTheNumbers
 
               |7
 
               |7
               |year=2013}}
+
               |year=2013
 +
              |language=en}}
 
     |useprev=2013PrevLink
 
     |useprev=2013PrevLink
 
     |prev=A5-{{Top_10_2010:ByTheNumbers
 
     |prev=A5-{{Top_10_2010:ByTheNumbers
 
               |5
 
               |5
               |year=2013}}}}
+
               |year=2013
 +
              |language=en}}
 +
    |year=2013
 +
    |language=en
 +
}}
  
 
[[Category:OWASP Top Ten Project]]
 
[[Category:OWASP Top Ten Project]]

Latest revision as of 16:04, 23 June 2013

← A5-Security Misconfiguration
2013 Table of Contents

2013 Top 10 List

A7-Missing Function Level Access Control →
Threat Agents Attack Vectors Security Weakness Technical Impacts Business Impacts
Application Specific Exploitability
DIFFICULT
Prevalence
UNCOMMON
Detectability
AVERAGE
Impact
SEVERE
Application / Business Specific
Consider who can gain access to your sensitive data and any backups of that data. This includes the data at rest, in transit, and even in your customers’ browsers. Include both external and internal threats.

Attackers typically don’t break crypto directly. They break something else, such as steal keys, do man-in-the-middle attacks, or steal clear text data off the server, while in transit, or from the user’s browser.

The most common flaw is simply not encrypting sensitive data. When crypto is employed, weak key generation and management, and weak algorithm usage is common, particularly weak password hashing techniques. Browser weaknesses are very common and easy to detect, but hard to exploit on a large scale. External attackers have difficulty detecting server side flaws due to limited access and they are also usually hard to exploit.

Failure frequently compromises all data that should have been protected. 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 'Sensitive Data Exposure'?

The first thing you have to determine is which data is sensitive enough to require extra protection. For example, passwords, credit card numbers, health records, and personal information should be protected. For all such data:

  1. Is any of this data stored in clear text long term, including backups of this data?
  2. Is any of this data transmitted in clear text, internally or externally? Internet traffic is especially dangerous.
  3. Are any old / weak cryptographic algorithms used?
  4. Are weak crypto keys generated, or is proper key management or rotation missing?
  5. Are any browser security directives or headers missing when sensitive data is provided by / sent to the browser?

And more … For a more complete set of problems to avoid, see ASVS areas Crypto (V7), Data Prot. (V9), and SSL (V10).

How Do I Prevent 'Sensitive Data Exposure'?

The full perils of unsafe cryptography, SSL usage, and data protection are well beyond the scope of the Top 10. That said, for all sensitive data, do all of the following, at a minimum:

  1. Considering the threats you plan to protect this data from (e.g., insider attack, external user), make sure you encrypt all sensitive data at rest and in transit in a manner that defends against these threats.
  2. Don’t store sensitive data unnecessarily. Discard it as soon as possible. Data you don’t have can’t be stolen.
  3. Ensure strong standard algorithms and strong keys are used, and proper key management is in place. Consider using FIPS 140 validated cryptographic modules.
  4. Ensure passwords are stored with an algorithm specifically designed for password protection, such as bcrypt, PBKDF2, or scrypt.
  5. Disable autocomplete on forms collecting sensitive data and disable caching for pages that contain sensitive data.
Example Attack Scenarios

Scenario #1: An application encrypts credit card numbers in a database using automatic database encryption. However, this means it also decrypts this data automatically when retrieved, allowing an SQL injection flaw to retrieve credit card numbers in clear text. The system should have encrypted the credit card numbers using a public key, and only allowed back-end applications to decrypt them with the private key.

Scenario #2: A site simply doesn’t use SSL for all authenticated pages. Attacker simply monitors network traffic (like an open wireless network), and steals the user’s session cookie. Attacker then replays this cookie and hijacks the user’s session, accessing the user’s private data.

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 of the unsalted hashes can be exposed with a rainbow table of precalculated hashes.

References

OWASP
For a more complete set of requirements, see ASVS req’ts on Cryptography (V7), Data Protection (V9) and Communications Security (V10)

External


← A5-Security Misconfiguration
2013 Table of Contents

2013 Top 10 List

A7-Missing Function Level Access Control →

© 2002-2013 OWASP Foundation This document is licensed under the Creative Commons Attribution-ShareAlike 3.0 license. Some rights reserved. CC-by-sa-3 0-88x31.png