29 October 2026·2 min read
Every Webhook You Receive Could Be Fake
Webhooks tell your app that a payment succeeded or an order changed. If you don't verify them, anyone can send a fake one. How to handle webhooks safely.
Webhooks are everywhere. A payment provider tells your app "this payment succeeded". A store platform says "this order was created". A code host says "new code was pushed". Your app receives a request and acts on it: mark the order as paid, ship the product, start a deployment.
The catch is that a webhook is just an HTTP request. If your webhook address is public and you don't check where requests come from, anyone can send you one. That includes a fake "payment succeeded".
Mistake 1: Not Verifying the Signature
Good webhook providers sign every request. They use a shared secret to create a signature and send it in a header. Your app should recompute the signature and compare. If it doesn't match, reject the request. No exceptions.
Many apps skip this step "for now". Then it's forgotten, and the endpoint stays open.
Mistake 2: Accepting Old Requests
Even a correctly signed request can be captured and sent again later. This is called a replay attack.
Most providers include a timestamp. Check it, and reject requests that are too old (for example, older than five minutes).
Mistake 3: Processing the Same Webhook Twice
Providers often send the same webhook more than once. Networks fail and retries happen, which is normal. If your app isn't ready for it, though, one payment can become two orders, two emails or two shipments.
The fix is idempotency: remember which webhook IDs you have already processed, and safely ignore repeats.
Mistake 4: Doing Slow Work Before Replying
Providers expect a quick reply. If your app does heavy work first (sending emails, calling other services), the provider may time out and send the webhook again.
Reply quickly to say you received it, then do the slow work in the background.
Mistake 5: Trusting Everything Inside It
Even a verified webhook is just a message. For important actions, like a large payment, it can be worth double-checking the details with the provider's API before acting.
Sending Webhooks? Be a Good Sender
If your own product sends webhooks to customers, the same care applies from the other side:
- Sign every request, so receivers can verify it
- Retry with backoff when the receiver is down, not instantly in a loop
- Protect against SSRF: don't let customers point your webhooks at internal addresses in your own network
The Webhook Checklist
When receiving:
- Verify the signature on every request
- Reject requests with old timestamps
- Process each webhook ID only once
- Reply fast, do slow work in the background
- Double-check high-value actions
When sending:
- Sign every request
- Retry with backoff
- Block internal and private addresses
Tools I Built for This
Webhooks come up in almost every project, so I built three small open-source libraries that cover the full journey:
- hooksend: send webhooks reliably, with signing, retries and SSRF protection
- hookseal: verify signatures from Stripe, GitHub, Shopify, Razorpay, Slack and more with one API
- twiceless: process each request exactly once, with idempotency keys
Conclusion
Treat every incoming webhook as untrusted until you have proved it is real, recent and new.
Newsletter
Get New Posts by Email.
New posts on building, shipping and leading tech teams, sent to your inbox. No spam, and you can unsubscribe any time.
Keep Reading
More Posts.
26 October 2026·2 min
Never Paste Customer Data Into AI. Do This Instead.
Pasting customer data into AI tools is fast, and risky. How to get the benefits of AI without leaking personal data, with simple steps any team can follow.
Read Post24 October 2026·2 min
The Boring Tech Stack That Will Still Work in 10 Years
New frameworks appear every month. The tools that quietly power most successful products are usually boring, proven and well understood. Why that is a strength.
Read Post19 October 2026·2 min
Monolith or Microservices? Start With a Monolith. Here's Why.
Microservices sound modern, but most teams start them too early and pay a high price. Why a well-built monolith is usually the smarter first choice.
Read Post