Skip to content

Commit 78ea6d6

Browse files
authored
PHPSDK-180: Use constant-time string comparison in Notification::verifyNotification
1 parent b53268f commit 78ea6d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Util/Notification.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ public static function verifyNotification(
5050
$payload = $timestamp . ':' . $request;
5151
$hash = hash_hmac('sha512', $payload, trim($apiKey));
5252

53-
return $hash === $sha512hexPayload;
53+
return hash_equals($hash, $sha512hexPayload);
5454
}
5555
}

0 commit comments

Comments
 (0)