Hi dev,
I would like to point out a security issue in the EncryptService class :
protected function hash_equals($a, $b) {
if (function_exists('random_bytes')) {
$key = random_bytes(128);
} else {
$key = openssl_random_pseudo_bytes(128);
}
return hash_hmac('sha512', $a, $key) === hash_hmac('sha512', $b, $key);
}
A simple strict equals sign === is used for hash comparison, which is vulnerable to timing attack.
The hash_equals() function should be used (http://php.net/manual/en/function.hash-equals.php) for comparing hashes.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Hi dev,
I would like to point out a security issue in the EncryptService class :
A simple strict equals sign
===is used for hash comparison, which is vulnerable to timing attack.The
hash_equals()function should be used (http://php.net/manual/en/function.hash-equals.php) for comparing hashes.Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.