Skip to content

Commit a31a6e3

Browse files
Cacciuctechknowlogicklunny
authored
proper signature validation (#13523)
$header_signature could be a typed float (start with 0e and then only numbers) and a float does equal a string when comparing with typed juggle. eg: 0e123 != "abc" does return false, but 0e123 !== "abc" returns true. you previously could circumvent the signature check when providing a header signature in the float format (0e...) Co-authored-by: techknowlogick <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
1 parent db16275 commit a31a6e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/content/doc/features/webhooks.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ if (empty($header_signature)) {
168168
$payload_signature = hash_hmac('sha256', $payload, $secret_key, false);
169169
170170
// check payload signature against header signature
171-
if ($header_signature != $payload_signature) {
171+
if ($header_signature !== $payload_signature) {
172172
error_log('FAILED - payload signature');
173173
exit();
174174
}

0 commit comments

Comments
 (0)