Guide Cybersecurity 9 min read

Webhook signing at Stripe, GitHub, Shopify and Slack compared

A webhook signature lets your server check that a request came from the service it names and was not changed on the way. Stripe, GitHub, Shopify and Slack sign three different strings and send four different headers, and we measured what makes their checks fail on one test body.

Kenji Tanaka
Developer Tools & Cloud Analyst
Published 24 Nov 2026, 9:25 PM (SGT)
Share:
A brass wax-seal stamp rests on a sealed envelope beside three pressed gold seals on a wooden table.
Photo by Yoav Franco on Pexels
Advertisement

Key points

  • Stripe signs t.body, Slack signs v0:t:body, and GitHub and Shopify sign the raw body alone, all with HMAC-SHA256.
  • Six small edits to an 88-byte body (whitespace, key order, a newline, a Unicode form) failed all four schemes in our test: 24 of 24 checks.
  • Two of the four schemes put a time inside the signature (Stripe and Slack). GitHub and Shopify leave repeated deliveries to delivery IDs and idempotent handling.
  • One Shopify signature has four base64 spellings that decode to the same 32 bytes, so compare decoded bytes and check the length first.
  • Stripe’s v0 entry is a test fake to ignore, while Slack’s v0 is its live scheme.

A webhook is an HTTP request that a service such as Stripe or GitHub sends to your server when something happens, and its signature header lets your code check who sent it and that nothing changed in transit. Stripe, GitHub, Shopify and Slack all sign with HMAC-SHA256, a keyed-hash message authentication code (MAC), but they sign three different strings and write the result four different ways. On 24 November 2026 we signed one 88-byte test body with a throwaway key under all four schemes and changed the body six ways; all 24 checks failed. A seventh copy, made by a Node.js parse-and-stringify round trip, passed only because it happened to return identical bytes.

What goes into each signature

Stripe’s webhooks documentation describes a signature over the timestamp, a full stop and "the unmodified HTTP request body", sent as v1 entries beside t= in the Stripe-Signature header. Its examples are hex, and Stripe’s Node library, stripe-node v23.2.0, computes hex. According to GitHub’s page on validating webhook deliveries, a hex digest of the payload arrives in X-Hub-Signature-256 and "always starts with sha256=".

Shopify’s verify-deliveries page documents base64 with no prefix, computed over the raw body. On Slack’s request-verification page, the signed string is v0, the timestamp and the body joined with colons, and the hex digest carries a v0= prefix; the timestamp also travels in X-Slack-Request-Timestamp. GitHub’s and Slack’s published example values reproduced exactly in our check.

Four cards. GitHub and Shopify sign the raw body alone, in hex with a sha256= prefix and in base64 with no prefix. Stripe signs the timestamp, a full stop and the body. Slack signs v0, the timestamp and the body joined by colons. Only Stripe and Slack have a time inside the signature.
One test body and one throwaway key give four different headers. GitHub’s hex value and Shopify’s base64 value are the same 32 bytes. RECATOOLS, from each provider’s documentation, read 24 November 2026

GitHub and Shopify sign identical bytes, so their headers differ only in encoding. Which hash to use in the first place is the subject of our guide to choosing a hash, where webhook signatures get one row.

Parsed JSON is rarely the body that was signed

We checked each changed copy of the 88-byte body against the four original headers.

Body as receivedBytesChecks passed
Original884 of 4
Node JSON.stringify(JSON.parse(body))884 of 4
Pretty-printed, two-space indent1090 of 4
Same keys, different order880 of 4
Python json.dumps default style1010 of 4
Trailing line feed890 of 4
Trailing CRLF (carriage return plus line feed)900 of 4
é as e plus a combining accent890 of 4

Reordered keys keep the length and still fail, because the MAC covers bytes and knows nothing of JSON. The Node round trip is the trap. A test with a compact body passes, and the same code fails on the first body the parser cannot reproduce. On a second, 111-byte body holding 12.50 and a 20-digit integer, Node 26, Python 3.9 and PHP 8.5 all changed the bytes, even Python’s compact setting.

Node 26.13.0 and Python 3.9.6: the round trip that passes by accident
printf '%s' '{"id":"evt_test_0001","type":"order.paid","amount":1250,"currency":"SGD","note":"café"}' > body.json
node -e 'const b=require("fs").readFileSync("body.json","utf8");console.log(JSON.stringify(JSON.parse(b))===b)'
true
python3 -c 'import json;b=open("body.json",encoding="utf-8").read();print(json.dumps(json.loads(b))==b)'
False

OWASP’s Webhook Security Cheat Sheet already lists re-serialising, reordering, whitespace, line endings and re-encoding as ways to break a signature, and Stripe, Shopify and GitHub each warn against a modified body. All of them point to the same defence, which is to capture the request body as bytes before any parser touches it.

Stripe and Slack put the time inside the MAC

Stripe says its libraries "have a default tolerance of 5 minutes" and that a tolerance of 0 "disables the recency check entirely"; a retried event gets a new timestamp and signature. Slack’s sample rejects a gap of more than 60 × 5 seconds either way. In our verifier, editing t by one second broke the signature, and a genuine header was accepted when checked 300 seconds after t and rejected at 301 seconds.

A genuine Stripe header was accepted at 0, 299 and 300 seconds and rejected at 301 and 3,600 seconds and at 301 seconds before t. Editing t by one second either way failed the signature check. The check in stripe-node v23.2.0 has an upper bound of 300 seconds and no lower bound.
Our verifier against Stripe’s scheme with a 300-second tolerance, and the shape of stripe-node’s check as read in its source. RECATOOLS, measured 24 November 2026

Read in its source at v23.2.0 and not run, stripe-node rejects a timestamp more than 300 seconds old and sets no lower bound, where the documentation speaks of anything "outside your tolerance". That matters only for clock skew, since t cannot be moved without the secret.

GitHub and Shopify sign the body alone, so a delivery resent byte for byte verifies, and GitHub’s delivery ID, like Shopify’s delivery-ID and timestamp headers, sits outside the MAC. OWASP notes that verification "alone does not stop repeated processing". GitHub’s best practices page suggests X-GitHub-Delivery to keep deliveries unique, adding that a redelivery you request keeps the same ID; Shopify points to X-Shopify-Webhook-Id, and Stripe to logging the event IDs you have processed.

Reproducing the headers in a browser

Every header above can be rebuilt by hand in our HMAC generator. Enter w222-test-key-not-a-real-secret as the secret, choose SHA-256 and paste the body without a trailing newline. The hex output then starts 964fd014, which is GitHub’s value once sha256= goes in front, and the base64 output is Shopify’s header. Typing 1795000000. before the body gives Stripe’s v1 value, and v0:1795000000: gives Slack’s. One press of Enter after the body changes the output to e14b6aa6…, the trailing line feed in the table.

Browser text boxes rewrite line endings

A browser text box turns CRLF into LF, so a body sent with CRLF line endings cannot be reproduced by pasting it. Our test body with a trailing CRLF should give 8163a5f9…; pasted into a text box it signs as the LF version, e14b6aa6….

The page says this beside its Message field. For a body with CRLF endings, sign the saved bytes in a terminal instead.

The page has no compare field, no clock and no binary-secret input. Node’s built-in crypto gives the same four headers from the saved bytes.

Advertisement
Node 26.13.0: one body, four providers’ headers
node -e 'const c=require("crypto"),b=require("fs").readFileSync("body.json"),k="w222-test-key-not-a-real-secret",t="1795000000",mac=(m,e)=>c.createHmac("sha256",k).update(m).digest(e);console.log("X-Hub-Signature-256: sha256="+mac(b,"hex"));console.log("Stripe-Signature: t="+t+",v1="+mac(Buffer.concat([Buffer.from(t+"."),b]),"hex"));console.log("X-Shopify-Hmac-Sha256: "+mac(b,"base64"));console.log("X-Slack-Signature: v0="+mac(Buffer.concat([Buffer.from("v0:"+t+":"),b]),"hex"))'
X-Hub-Signature-256: sha256=964fd01413858486cbeeeca05afdceb367cfc83973a82367ea27a38e6e9fc7a8
Stripe-Signature: t=1795000000,v1=fc40ca83825cc0d59df45b8d018f52dd8cfd02f238b406b86d62f818021f5204
X-Shopify-Hmac-Sha256: lk/QFBOFhIbL7uygWv3Os2fPyDlzqCNn6iejjm6fx6g=
X-Slack-Signature: v0=53b3b52a0070134fd68ffccd5442f67c07daa56ebc460045163f2f251d617886

Secret rotation adds a second signature

Stripe lets you delay an old secret’s expiry by up to 7 days, and meanwhile it "generates one signature per secret". Code that reads only the first v1 rejects a genuine delivery during that window. Stripe asks for a comparison against every v1, in whatever order the entries arrive. Shopify differs, since after a rotation "it can take up to an hour" before deliveries use the new secret.

The header we built for a rotation

t=1795000000,v1=3c845b47…,v1=fc40ca83…,v0=00000000…

The first v1 is signed with a second throwaway key standing in for the old secret, and the other v1 with the current key. The v0 entry of zeros stands in for the fake Stripe adds to sandbox events. Accepting any matching v1 passed this header; reading only the first rejected it.

Compare decoded bytes in constant time

GitHub’s advice reads "Never use a plain == operator" and points to a constant-time function such as crypto.timingSafeEqual; OWASP gives the same rule. We tried to time the difference in Node and the ranges overlapped too much to mean anything, so we publish no timing figure.

Shopify’s published sample decodes both values from base64 and compares bytes. A 32-byte MAC becomes 44 base64 characters with one =, and the last data character carries two spare bits, so our header could end 6g=, 6h=, 6i= or 6j= and decode to the same bytes. A decoded comparison accepted all four and a string comparison accepted one. That does not weaken Shopify’s scheme, since all four carry the correct MAC; it bites where the header is stored or deduplicated as text. Our guide to sixteen spellings of one byte shows the same effect on a single byte.

Our Shopify header ends 6g=. Changing only the last data character to h, i or j gives three more spellings that decode to the same 32 bytes. Comparing decoded bytes accepted all four; comparing the header as a string accepted one. Endings 6f= and 6k= decode to different bytes.
The last data character of a 32-byte MAC’s base64 form carries two spare bits, so four spellings decode alike. RECATOOLS, measured 24 November 2026 with Node 26.13.0

Node 26.13.0 decodes base64 leniently, and a valid header with !!! appended still compared equal. Given a decoded value of the wrong length (a hex digest, a header cut short by four characters, an empty header), Shopify’s sample as published threw a RangeError in all three cases. Checking for 32 bytes before comparing, and treating any exception as a rejection, turns each of those three into a plain rejection.

Python 3.9.6: verify GitHub, Shopify and Stripe from the saved bytes
python3 -c 'import hmac,hashlib,base64;b=open("body.json","rb").read();k=b"w222-test-key-not-a-real-secret";mac=hmac.new(k,b,hashlib.sha256).digest();gh="sha256=964fd01413858486cbeeeca05afdceb367cfc83973a82367ea27a38e6e9fc7a8";sh=base64.b64decode("lk/QFBOFhIbL7uygWv3Os2fPyDlzqCNn6iejjm6fx6g=");print("github ", hmac.compare_digest("sha256="+mac.hex(),gh));print("shopify", len(sh)==32 and hmac.compare_digest(mac,sh))'
github  True
shopify True
python3 -c 'import hmac,hashlib;b=open("body.json","rb").read();k=b"w222-test-key-not-a-real-secret";h="t=1795000000,v1=fc40ca83825cc0d59df45b8d018f52dd8cfd02f238b406b86d62f818021f5204";e=[x.split("=",1) for x in h.split(",")];t=[v for n,v in e if n=="t"][0];exp=hmac.new(k,t.encode()+b"."+b,hashlib.sha256).hexdigest();ok=any(hmac.compare_digest(exp,v) for n,v in e if n=="v1");[print("age",now-int(t),"accept" if ok and abs(now-int(t))<=300 else "reject") for now in (1795000000,1795000300,1795000301)]'
age 0 accept
age 300 accept
age 301 reject

A v0 label with opposite meanings

Stripe says "the only valid live signature scheme is v1", adds a fake v0 signature to sandbox events for testing, and says to ignore every other scheme to prevent downgrade attacks. At Slack, v0 is the live scheme, so a helper reused across the two reads the label backwards. GitHub keeps a leftover too. The older X-Hub-Signature header uses HMAC-SHA1 and "is only included for legacy purposes".

Verifying a webhook signature

0 of 8 done

  1. Stripe, Shopify and GitHub each warn that a modified body fails verification.

  2. Stripe: t, a full stop, the body. Slack: v0, t and the body joined by colons. GitHub and Shopify: the body alone.

  3. sha256= for GitHub, v0= for Slack, base64 for Shopify.

  4. A decoded HMAC-SHA256 is 32 bytes; treat any exception as a rejection.

  5. crypto.timingSafeEqual in Node, hmac.compare_digest in Python, as GitHub and OWASP advise.

  6. Rotation can put two v1 entries in one header, and the v0 entry is a test fake.

  7. Stripe’s libraries default to 5 minutes, and Stripe says a tolerance of 0 disables the check; Slack’s sample uses 5 minutes either way.

  8. X-GitHub-Delivery, X-Shopify-Webhook-Id, or Stripe’s event ID.

Your ticks are saved in this browser only.

Pages read, versions run and what will date them

The pages linked above were read on 24 November 2026. So was RFC 9110, whose section 5.1 makes header names case-insensitive, which means Shopify’s two spellings, -SHA256 and -Sha256, name one header. Stripe’s Node library was read at its v23.2.0 tag, published 19 November 2026, and not run. We measured with Node 26.13.0 (OpenSSL 4.1.0), Python 3.9.6 and PHP 8.5.12 at a fixed time of 1795000000 (18 November 2026, 11:06:40 UTC); the counts are ours. Header names, Stripe’s default tolerance and Shopify’s rotation delay will date first.

Advertisement
Kenji Tanaka
Developer Tools & Cloud Analyst

Kenji Tanaka covers developer tools, cloud platforms, DevOps, CI/CD, and software supply-chain topics for RECATOOLS.

View author profile → · Editorial policy

About this byline Kenji Tanaka is a RECATOOLS editorial persona for developer tools, cloud, DevOps, and software supply-chain coverage. Articles are produced and reviewed under RECATOOLS editorial supervision.

Corrections policy

Go further

Relevant tools

More from Cybersecurity

Advertisement
Advertisement