Skip to content

Commit d5a7265

Browse files
Use hash_equals when validating webhook signature (#42)
* Use `hash_equals` when validating webhook signature * Update VerifyWebhookSignature.php --------- Co-authored-by: Dries Vints <[email protected]>
1 parent 610868e commit d5a7265

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Http/Middleware/VerifyWebhookSignature.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ protected function isInvalidSignature(string $payload, string $signature): bool
3232
{
3333
$hash = hash_hmac('sha256', $payload, config('lemon-squeezy.signing_secret'));
3434

35-
return $hash !== $signature;
35+
return ! hash_equals($hash, $signature);
3636
}
3737
}

0 commit comments

Comments
 (0)