About the Webhook Signature Verifier
Webhook İmza Doğrulayıcı Hakkında
Webhook signatures let you verify that an incoming webhook came from the expected sender, not from someone who guessed your endpoint URL. The sender and your server share a secret; the sender computes HMAC over the request body (often with a timestamp) and includes the result in a header. Your server recomputes and compares.
This tool lets you test signature schemes for Stripe, GitHub, Slack, and custom HMAC formats. Paste a body, a secret, and the received header; the tool computes the expected signature and tells you whether it matches. Useful for confirming server-side verification code, generating test fixtures, and understanding the exact scheme a provider uses.
All computation happens in your browser. Treat the secret you paste like a password — close the tab when done. Better practice: use test-mode secrets for any tool experimentation, and rotate before production use.
Webhook imzaları, gelen webhook'un beklenen göndericiden geldiğini — endpoint URL'inizi tahmin edenden değil — doğrulamanızı sağlar. Gönderici ve sunucunuz bir secret paylaşır; gönderici request body üzerinde (genellikle bir timestamp ile) HMAC hesaplar ve sonucu bir header'a koyar. Sunucunuz yeniden hesaplar ve karşılaştırır.
Bu araç Stripe, GitHub, Slack ve custom HMAC formatları için imza şemalarını test etmenize olanak verir. Body, secret ve gelen header'ı yapıştırırsınız; araç beklenen imzayı hesaplar ve eşleşip eşleşmediğini söyler. Sunucu tarafı doğrulama kodunu teyit etmek, test fixture'ları üretmek ve sağlayıcının kullandığı tam şemayı anlamak için faydalıdır.
Tüm hesaplama tarayıcınızda olur. Yapıştırdığınız secret'a şifre gibi davranın — işiniz bitince sekmeyi kapatın. Daha iyi pratik: araç deneylerinde test-mode secret kullanın, üretim öncesi rotate edin.
Provider-specific schemes
Sağlayıcıya özgü şemalar
Stripe. Header format: t={timestamp},v1={signature}. Signed payload: {timestamp}.{raw_body}. HMAC-SHA256 with the endpoint signing secret. Reject if timestamp is older than 5 minutes.
GitHub. Header: X-Hub-Signature-256: sha256={signature}. Signed payload is just the raw body. HMAC-SHA256 with the webhook secret.
Slack. Headers: X-Slack-Signature, X-Slack-Request-Timestamp. Signed string: v0:{timestamp}:{raw_body}. HMAC-SHA256 with signing secret, prefix result with v0=.
Stripe. Header formatı: t={timestamp},v1={imza}. İmzalanan payload: {timestamp}.{raw_body}. Endpoint imzalama secret'ı ile HMAC-SHA256. Timestamp 5 dakikadan eski ise reddedin.
GitHub. Header: X-Hub-Signature-256: sha256={imza}. İmzalanan payload sadece raw body. Webhook secret ile HMAC-SHA256.
Slack. Header'lar: X-Slack-Signature, X-Slack-Request-Timestamp. İmzalanan string: v0:{timestamp}:{raw_body}. Signing secret ile HMAC-SHA256, sonucu v0= ile ön ekleyin.
Verification pitfalls
Doğrulama tuzakları
- Verifying parsed JSON instead of raw bytes. Re-serializing changes the bytes; signature won't match.
- String comparison instead of timing-safe. Leaks information; use crypto.timingSafeEqual / hmac.compare_digest.
- No timestamp check. Without it, captured signatures replay indefinitely until the secret rotates.
- Logging the signature. Treat it like a bearer token; logs leak.
- Raw byte yerine parse edilmiş JSON'u doğrulamak. Yeniden serialize byte'ları değiştirir; imza eşleşmez.
- Timing-safe yerine string karşılaştırma. Bilgi sızdırır; crypto.timingSafeEqual / hmac.compare_digest kullanın.
- Timestamp kontrolü yok. Olmadan yakalanan imzalar secret rotate edilene kadar süresiz replay edilir.
- İmzayı loglamak. Bearer token gibi davranın; loglar sızar.
Frequently asked questions
Sık sorulan sorular
Why HMAC and not just a shared API key in a header?
HMAC proves possession of the secret without transmitting it. Key-in-header leaks the key on every request; HMAC leaks nothing — even with the signature in hand, you can't forge a request to a different body.
What's a sensible timestamp tolerance?
5 minutes is standard. Wider tolerates clock skew across systems; narrower tightens replay window. Don't go below 60 seconds without good reason.
How do I rotate secrets without downtime?
Most providers support 2+ active secrets simultaneously. Add the new secret, deploy the verifier to accept either, rotate the sender's active secret, then remove the old one from your verifier.
Is there a difference between SHA-256 and HMAC-SHA-256?
Yes — plain SHA-256 of (secret + body) is vulnerable to length-extension attacks. HMAC-SHA-256 wraps the hashing in a structure that prevents this. Always use HMAC.
Neden HMAC, sadece header'da paylaşılan API anahtarı değil?
HMAC, secret'ı iletmeden sahip olunduğunu kanıtlar. Header'daki anahtar her istekte anahtarı sızdırır; HMAC hiçbir şey sızdırmaz — imza elde olsa bile farklı body için istek üretemezsiniz.
Makul timestamp toleransı nedir?
5 dakika standart. Geniş, sistemler arası saat kaymasını tolere eder; dar replay penceresini sıkar. İyi sebep olmadan 60 saniyenin altına inmeyin.
Kesintisiz secret rotate nasıl?
Çoğu sağlayıcı eş zamanlı 2+ aktif secret destekler. Yeni secret'ı ekleyin, doğrulayıcıyı ikisini de kabul edecek şekilde dağıtın, göndericinin aktif secret'ını rotate edin, sonra eskisini doğrulayıcıdan kaldırın.
SHA-256 ile HMAC-SHA-256 farkı?
Evet — düz SHA-256 (secret + body) length-extension saldırılarına açıktır. HMAC-SHA-256 hash'lemeyi bunu engelleyen bir yapıyla sarar. Her zaman HMAC kullanın.