Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4133 pages

APIs and integrations

How GitHub, Shopify and Slack Sign Webhooks, Compared

In short

Webhook signature verification code copied from one vendor will reject every genuine delivery from the next. GitHub, Shopify and Slack all use HMAC-SHA256, but GitHub sends hex behind a sha256= prefix, Shopify sends Base64 keyed by the app's client secret, and Slack signs a timestamp joined to the body. Only Slack builds in a replay window.

What does each vendor send, and what exactly is signed?

The algorithm is the only thing the three share. The header, the key, the string fed to the HMAC and the way the result is written all change, and each one is enough to make a correct secret look wrong.

Slack is the odd one out on the signed string. It does not hash the body alone: it hashes the literal v0, a colon, the request timestamp, another colon, then the body. Skip the prefix or the timestamp and every check fails.

DetailGitHubShopifySlack
Signature header`X-Hub-Signature-256` (legacy `X-Hub-Signature` uses HMAC-SHA1)`X-Shopify-Hmac-SHA256``X-Slack-Signature`, read with `X-Slack-Request-Timestamp`
KeyThe secret you set on the webhookThe app's client secretThe app's Signing Secret
Input to the HMACThe payload as deliveredThe raw request body`v0:` + timestamp + `:` + raw body
How the result is writtenHex digest after `sha256=`Base64Hex digest after `v0=`
Timestamp inside the signatureNoNoYes

Checked against: source 1, source 3, source 5

Why does webhook signature verification fail after a body parser runs?

All three sign bytes, not parsed JSON. Re-serializing changes spacing, key order or Unicode escapes, and the digest no longer matches. Shopify says to capture the body before any parser runs; Slack says to hash it before deserializing and, in Flask, to call request.get_data() first; GitHub says not to modify the payload or headers and to treat the payload as UTF-8.

Comparison needs care too. GitHub warns against a plain equality operator and names secure_compare and crypto.timingSafeEqual; Shopify's example uses crypto.timingSafeEqual on the decoded Base64 values; Slack asks for an HMAC compare function. Strip sha256= or v0= before comparing hex, and decode Shopify's Base64 rather than comparing strings.

GitHub publishes a test vector worth keeping in a unit test: the secret It's a Secret to Everybody and the payload Hello, World! must produce 757107ea0eb2509fc211221cce984b8a37570b6d7586c22c46f4379c8b043e17. The same raw-body mistake on Stripe has its own page: Stripe webhook signature verification failed.

Checked against: source 1, source 3, source 5

Which of the three stops a replayed delivery?

Slack does, because the timestamp is inside the signed string. Its docs reject a request whose timestamp is more than five minutes from local time, so an intercepted request cannot be replayed later with a fresh clock value. Keep the server clock in sync or real requests fail this check.

GitHub's signature carries no time. Its best-practice page treats replay as a delivery-ID problem: X-GitHub-Delivery is unique per event, and a manual redelivery keeps the original value. Storing processed IDs is what blocks a replay there.

Shopify's HMAC also has no timestamp. X-Shopify-Webhook-Id is unique per delivery and is the one to dedupe on. X-Shopify-Event-Id is shared by deliveries from the same merchant action across several subscriptions, so it is for correlation. X-Shopify-Triggered-At is offered for ordering, not for rejecting old requests. For how Stripe and Adyen handle the same question, see Stripe vs Adyen idempotency and webhooks.

Checked against: source 2, source 3, source 4, source 5

How do you rotate a webhook secret without dropping deliveries?

Shopify is the only one of the three that states a lag. After the app's client secret is rotated, it can take up to an hour before digests use the new one. I would accept either secret for that hour, then drop the old one.

Slack's docs show only a Regenerate button for the Signing Secret and give no overlap period for it. The 24-hour grace period on the same page belongs to the client secret, which is an OAuth credential, not the signing key. GitHub says you can update a webhook's secret in its settings and describes no overlap either.

Where no overlap is documented, a short dual-check window on your side is a design choice, not a vendor promise. Deliveries signed with the old secret during the switch may otherwise fail and need redelivery.

Checked against: source 1, source 3, source 5

What should the receiving endpoint do besides checking the HMAC?

None of this replaces the signature check. It limits what a forged or replayed request can reach if a secret leaks.

  • Answer fast. GitHub ends the connection after 10 seconds without a 2XX. Shopify allows one second to connect and five seconds for the whole request, and counts any non-2XX, redirects included, as an error.
  • Know the retry story. Shopify retries 8 times over 4 hours; after 8 consecutive failures it deletes subscriptions made through the Admin API. GitHub's best-practice page tells you to redeliver missed events yourself after downtime. Slack's Events API retries are covered in Slack API rate limit tiers.
  • Reconcile. Shopify says delivery is not always guaranteed and recommends a periodic job that fetches data through its APIs, using updated_at filters where available.
  • Narrow the network. GitHub suggests an allowlist built from GET /meta, refreshed because the addresses change, and keeping SSL verification on. Slack offers mutual TLS as an alternative to signing, checking the certificate name platform-tls-client.slack.com.

Checked against: source 2, source 3, source 4, source 5

What else do people ask?

Can one verification function serve GitHub, Shopify and Slack?

Only if it takes the signed string, the key and the encoding as inputs. Slack needs the timestamp and the v0 prefix in the string, and Shopify needs Base64 instead of hex.

Is the old X-Hub-Signature header still safe to use?

GitHub keeps it for legacy reasons and it uses HMAC-SHA1. Its docs recommend X-Hub-Signature-256 instead.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. This page compares GitHub, Shopify and Slack documents fetched on 20 Nov 2026. I did not run webhook receivers for it, so nothing here is a test result. It does not cover Shopify Pub/Sub or EventBridge delivery, GitHub App installation tokens, Slack interactivity payload formats, or any rotation behaviour the docs leave unstated. Found a mistake? Tell me.

Keep reading

Next step

Have a project in mind?

Tell me about it. A discovery call within 48 hours.