Skip to content

Commit

Permalink
Updated _password_verify_sha1_legacy() to use hash_equals instead of …
Browse files Browse the repository at this point in the history
…a strict string comparison in order to mitigate timing attacks

This resolves #1555
  • Loading branch information
benedmunds committed Mar 23, 2022
1 parent 72352df commit f08cd91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/Ion_auth_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -2776,7 +2776,7 @@ protected function _password_verify_sha1_legacy($identity, $password, $hashed_pa
}

// Now we can compare them
if($hashed_password === $hashed_password_db)
if(hash_equals($hashed_password, $hashed_password_db))
{
// Password is good, migrate it to latest
$result = $this->_set_password_db($identity, $password);
Expand Down

0 comments on commit f08cd91

Please sign in to comment.