mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-14 04:13:46 +02:00
Fixing timing attack vuln. on HMAC comparison (#409)
This commit is contained in:
@@ -170,7 +170,7 @@ class HMACAuthorization
|
||||
*/
|
||||
protected function validateContents()
|
||||
{
|
||||
if (base64_decode($this->hash()) !== $this->generateSignature()) {
|
||||
if (! hash_equals(base64_decode($this->hash()), $this->generateSignature())) {
|
||||
throw new BadRequestHttpException('The HMAC for the request was invalid.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user