[Forgot Password]
Login  Register Subscribe

30479

 
 

423868

 
 

251139

 
 

909

 
 

196159

 
 

282

Paid content will be excluded from the download.


Download | Alert*
CWE
view XML

Use of a One-Way Hash without a Salt

ID: 759Date: (C)2012-05-14   (M)2022-10-10
Type: weaknessStatus: INCOMPLETE
Abstraction Type: Class





Description

The software uses a one-way cryptographic hash against an input that should not be reversible, such as a password, but the software does not also use a salt as part of the input.

Extended Description

This makes it easier for attackers to pre-compute the hash value using dictionary attack techniques such as rainbow tables.

Applicable Platforms
None

Related Attack Patterns

Common Consequences

ScopeTechnical ImpactNotes
Access_Control
 
Bypass protection mechanism
Gain privileges / assume identity
 
If an attacker can gain access to the hashes, then the lack of a salt makes it easier to conduct brute force attacks using techniques such as rainbow tables.
 

Detection Methods
None

Potential Mitigations

PhaseStrategyDescriptionEffectivenessNotes
Architecture and Design
 
 Use a cryptographic hash function that can be configured to change the amount of computational effort needed to compute the hash, such as the number of iterations ("stretching") or the amount of memory required. Some hash functions perform salting automatically. These functions can significantly increase the overhead for a brute force attack, far more than standards such as MD5, which are intentionally designed to be fast. For example, rainbow table attacks can become infeasible due to the high computing overhead. Finally, since computing power gets faster and cheaper over time, the technique can be reconfigured to increase the workload without forcing an entire replacement of the algorithm in use.
Some hash functions that have one or more of these desired properties include bcrypt, scrypt, and PBKDF2. While there is active debate about which of these is the most effective, they are all stronger than using salts with hash functions with very little computing overhead.
Note that using these functions can have an impact on performance, so they require special consideration to avoid denial-of-service attacks. However, their configurability provides finer control over how much CPU and memory is used, so it could be adjusted to suit the environment's needs.
 
High
 
 
Architecture and Design
 
 If a technique that uses stretching cannot be implemented, then generate a random salt each time a new password is processed. Add the salt to the plaintext password before hashing it. When storing the hash, also store the salt. Do not use the same salt for every password (CWE-760). [R.759.3]
 
Moderate
 
 
Implementation
Architecture and Design
 
 When using industry-approved techniques, use them correctly. Don't cut corners by skipping resource-intensive steps (CWE-325). These steps are often essential for preventing common attacks.
 
  

Relationships

Related CWETypeViewChain
CWE-759 ChildOf CWE-903 Category CWE-888  

Demonstrative Examples   (Details)

  1. In both of these examples, a user is logged in if their given password matches a stored password: (Demonstrative Example Id DX-101)
  2. In this example, a new user provides a new username and password to create an account. The program hashes the new user's password then stores it in a database.

Observed Examples

  1. CVE-2008-1526 : Router does not use a salt with a hash, making it easier to crack passwords.
  2. CVE-2006-1058 : Router does not use a salt with a hash, making it easier to crack passwords.

For more examples, refer to CVE relations in the bottom box.

White Box Definitions
None

Black Box Definitions
None

Taxynomy Mappings
None

References:

  1. Robert Graham .The Importance of Being Canonical. 2009-02-02.
  2. Thomas Ptacek .Enough With The Rainbow Tables: What You Need To Know About Secure Password Schemes. 2007-09-10.
  3. James McGlinn .Password Hashing.
  4. Jeff Atwood .Rainbow Hash Cracking. 2007-09-08.
  5. .Rainbow table. Wikipedia. 2009-03-03.
  6. M. Howard D. LeBlanc .Writing Secure Code 2nd Edition. Microsoft. Section:'Chapter 9, "Creating a Salted Hash" Page 302'. Published on 2002.
  7. Mark Dowd John McDonald Justin Schuh .The Art of Software Security Assessment 1st Edition. Addison Wesley. Section:'Chapter 2, "Salt Values", Page 46.'. Published on 2006.
  8. B. Kaliski .RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0. Published on 2000.
  9. Coda Hale .How To Safely Store A Password. 2010-01-31.
  10. Colin Percival .Tarsnap - The scrypt key derivation function and encryption utility.
  11. Brian Krebs .How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek). 2012-06-11.
  12. Solar Designer .Password security: past, present, future. Published on 2012.
  13. Troy Hunt .Our password hashing has no clothes. 2012-06-26.
  14. Joshbw .Should we really use bcrypt/scrypt?. 2012-06-08.
CVE    2
CVE-2021-21253
CVE-2020-16244

© SecPod Technologies