opyebWebhookLab

Guides · Operations

Webhook security checklist: 12 checks before you ship

2026-11-29 · 6 min read

One-line answer

Webhook security rests on five basics: verify the signature, keep the raw body, enforce a timestamp window, handle events idempotently, and answer 200 quickly.

Verification

  1. Always verify the signature. Reject failures with 401 and do not process the body.
  2. Keep the raw bytes. Apply raw-body settings to the route and verify before parsing.
  3. Compare in constant time. Use the language helper instead of string ==.
  4. Check the timestamp window. 300 seconds for Stripe, Slack and Toss Payments; without one, deduplicate by event ID.
  5. Keep secrets out of code. Environment variables or a secrets manager only.

Processing

  1. Make it idempotent. Deduplicate by eventId or delivery ID.
  2. Answer 200 quickly. Move heavy work to a queue and respond within ten seconds.
  3. Make failures retryable. 5xx for transient errors, 4xx for permanent ones.
  4. Do not assume order. Drop stale events using their created time.

Operations

  1. Design for secret rotation. Accept both secrets briefly during a switch.
  2. Do not over-log bodies. Mask personal and payment data; log hashes and byte counts.
  3. Monitor. Watch the 401 rate, processing delay and retry counts.

What each response code means

CodeMeaningSender behaviour
200received and verifiedstops retrying
401signature mismatchusually does not retry
400malformed bodydoes not retry
429rate limitedretries
5xxtransient failureretries

Returning 5xx for a verification failure makes the sender keep retrying a forged request. Use 401.

Final check

After deployment, use the provider's test event to confirm four things: a valid signature passes, an altered body is rejected, the same event sent twice is processed once, and a request older than the window is rejected. Those four mean the basics are covered.

Apply the checklist, then confirm the real request with the verifier.

Open the signature verifier

Frequently asked questions

If the webhook URL is secret, do I need signatures?

Yes. URLs leak through logs, browsers and proxies, and anyone with the URL can post to it. Signature verification is the baseline.

Is an IP allowlist enough?

It is a useful secondary control when the sender publishes stable IPs, but cloud senders change ranges, so it cannot replace signatures.

Should I store the body?

Often yes, for reprocessing. Encrypt or mask personal and payment data and set a retention period.

This guide follows the signing schemes published by GitHub, Stripe, Slack, Shopify and Toss Payments.

← Guides