This vulnerability occurs when software uses a hashing algorithm that is cryptographically weak, allowing attackers to feasibly reverse the hash to find the original input, find a different input that creates the same hash, or discover collisions where two inputs produce identical hash values.
A secure cryptographic hash function must be a one-way, deterministic process that reliably produces a unique fixed-length output (digest) from any input. For security, it must prevent three key attacks: recovering the original input from the hash (preimage attack), finding a different input that matches a given hash (second preimage attack), and generating two arbitrary inputs that hash to the same value (birthday attack). A 'weak' hash fails to adequately resist these attacks, often because the math behind it allows methods significantly faster than simple brute-force guessing. Weakness can stem from the algorithm itself (like MD5 or SHA-1, which are now considered broken for many uses) or from improper application. For example, using a cryptographically sound hash without a unique salt for password storage can enable pre-computed rainbow table attacks, effectively breaking the security the hash was meant to provide. The definition of a 'feasible' attack depends on context, but generally includes any method more efficient than brute force.
Impact: Bypass Protection Mechanism
Effectiveness: High
c
//Login if hash matches stored hash* if (equal(ctext, secret_password())) { ``` login_user(); } }
java
//Login if hash matches stored hash* if (equal(digest,secret_password())) { ``` login_user(); }
...
logic [31:0] data_d, data_q
logic [512-1:0] pass_data; ...
verilog
pass_data = { {60{8'h00}}, data_d};** state_d = PassChk; pass_mode = 1'b0; ... end ...
...
logic [512-1:0] data_d, data_q logic [512-1:0] pass_data; ...
verilog
pass_data = data_d;** state_d = PassChk; pass_mode = 1'b0; ... end ...