Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb129a8

Browse files
Merge branch '6.4' into 7.4
* 6.4: Allow defining security provider factories without config [FrameworkBundle] Bump Request/Session value resolver priority above EntityValueResolver [Security] Remove the legacy nested unserialize() call from token and exception classes [Yaml] Reject non-stringables when using "!!binary" [Messenger][Amqp] delayed quorum queues [Notifier] Use `hash_equals()` to compare webhook signatures for Vonage [Inflector][String] Fixed singularize `traces` > `trace` [AssetMapper] Warn on missing bare CSS and JSON imports When pushing, run GHA only on "*.*" branches [Console] Fix signal handler scoping [Security] Preserve webserver base URL in HttpUtils::createRequest()
2 parents 059348f + c0a83b9 commit cb129a8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Webhook/VonageRequestParser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ private function validateSignature(string $jwt, #[\SensitiveParameter] string $s
8383
}
8484

8585
[$header, $payload, $signature] = $tokenParts;
86-
if ($signature !== $this->base64EncodeUrl(hash_hmac('sha256', $header.'.'.$payload, $secret, true))) {
86+
$expected = $this->base64EncodeUrl(hash_hmac('sha256', $header.'.'.$payload, $secret, true));
87+
if (!hash_equals($expected, $signature)) {
8788
throw new RejectWebhookException(406, 'Signature is wrong.');
8889
}
8990
}

0 commit comments

Comments
 (0)