How to Verify Webhook HMAC Signatures (Stripe, GitHub, Shopify, Slack)
1. The Role of Webhook Cryptographic Signatures
Because webhook receiver endpoints are publicly accessible HTTP endpoints, attackers can forge fake payment or order completion payloads unless every request is cryptographically validated. Major providers use Hash-based Message Authentication Codes (HMAC-SHA256) to prove authenticity.
2. Why Webhook Verification Often Fails in Development
Developers frequently encounter signature verification errors due to subtle payload mutations:
- Body Parsing Mutation: Passing a JSON-parsed and re-stringified object instead of the exact, raw binary request buffer.
- Timestamp Skew & Formatting: Stripe prepends
t=timestamp,v1=signature; computing the HMAC over just the body fails. - Encoding Mismatches: Hexadecimal vs. Base64 signature representation mismatches across SDKs.
3. Zero-Knowledge Offline Verification
The MafLabs Webhook Signature Verifier runs Web Crypto API algorithms directly in your browser. You can test your secret key and raw payload without ever exposing private webhook secrets to an external server.
Try the Free Tool on MafLabs
Run 100% in your browser. Fast, ad-free, and private with zero cloud data retention.
Open Webhook Signature Verifier →