Security review fixes: keep pending-capture ids, ship uninstall.php (+verify step), webhook guard, IPv6 /64 + global order throttle, token-safe redirects, honest refund wording, request-id and overlay-token hardening
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
68bd917660
commit
473fe192cd
28 files changed
+747
-34
No files matched your search
@@ -116,9 +116,10 @@ final class Client {
|
||||
* @param array<string,mixed> $headers Incoming webhook request headers (any case; '-' or '_').
|
||||
*/
|
||||
public function verifyWebhook( array $headers, string $rawBody, string $webhookId ): bool {
|
||||
$h = array();
|
||||
foreach ( $headers as $k => $v ) {
|
||||
$h[ strtolower( str_replace( '-', '_', (string) $k ) ) ] = is_array( $v ) ? (string) ( $v[0] ?? '' ) : (string) $v;
|
||||
$h = WebhookGuard::normalizeHeaders( $headers );
|
||||
// Local pre-checks (headers present, paypal.com cert_url, replay window, size): never spend an outbound call on junk.
|
||||
if ( null !== WebhookGuard::check( $headers, $rawBody, time() ) ) {
|
||||
return false;
|
||||
}
|
||||
$event = json_decode( $rawBody );
|
||||
if ( ! is_object( $event ) || '' === $webhookId ) {
|
||||
|
||||
Reference in new issue
Block a user