Skip to content

Commit f08cd91

Browse files
authored
Updated _password_verify_sha1_legacy() to use hash_equals instead of a strict string comparison in order to mitigate timing attacks
This resolves #1555
1 parent 72352df commit f08cd91

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

models/Ion_auth_model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2776,7 +2776,7 @@ protected function _password_verify_sha1_legacy($identity, $password, $hashed_pa
27762776
}
27772777

27782778
// Now we can compare them
2779-
if($hashed_password === $hashed_password_db)
2779+
if(hash_equals($hashed_password, $hashed_password_db))
27802780
{
27812781
// Password is good, migrate it to latest
27822782
$result = $this->_set_password_db($identity, $password);

0 commit comments

Comments
 (0)