Prompt

What should I use for webhook signature verification and replay protection?

Technology / API Platforms2 observationsLast seen Nov 21, 2026

Latest observation

Nov 21, 2026OpenAI APIWeb search: off

Use both of these:

  1. Signature verification to prove the webhook came from the sender and wasn’t modified.
  2. Replay protection to stop an attacker from re-sending a valid old webhook.

Recommended approach

1) Verify the raw request body with HMAC

  • Have the provider sign the exact raw payload using a shared secret.
  • Recompute the signature on your side from the raw bytes, not parsed JSON.
  • Compare signatures using a constant-time comparison.

Typical choice:

  • HMAC-SHA256 over the raw request body

Why:

  • Simple
  • Widely supported
  • Good security when implemented correctly

2) Include a timestamp in the signature

Use a header like:

  • X-Webhook-Timestamp
  • X-Webhook-Signature

Then:

  • Reject requests with timestamps outside a small window, e.g. 5 minutes
  • This limits replay of captured requests

3) Use a unique event ID for deduplication

Best practice is to include a unique identifier like:

  • event_id
  • delivery_id
  • webhook_id

Store processed IDs in a database or cache with a TTL:

  • If you see the same ID again, ignore it

This is the strongest replay defense because:

  • Timestamp checks stop old replays
  • ID deduplication stops duplicate deliveries and repeated attacks within the time window

Best-practice combo

Use:

  • HMAC-SHA256 signature
  • Timestamp header
  • Unique event/delivery ID
  • Constant-time signature comparison
  • Raw body verification

Example verification flow

  1. Read raw request body
  2. Get timestamp and signature from headers
  3. Reject if timestamp too old/new
  4. Recompute expected signature from timestamp + "." + raw_body or whatever canonical format the provider specifies
  5. Compare signatures in constant time
  6. Check whether the event ID was already processed
  7. If new, process and store the ID

Important implementation notes

  • Don’t parse and reserialize JSON before verifying
  • Don’t use == for signature comparison
  • Don’t rely on IP allowlists alone
  • Rotate secrets periodically if supported
  • If the provider supports it, prefer a scheme with:
    • versioned signatures
    • timestamp
    • event IDs

If you want a concrete recommendation

For most systems:

  • HMAC-SHA256 + timestamp + event ID dedupe is the right choice

If you want, I can give you:

  • a sample implementation in Node.js, Python, Go, or Java
  • a recommended header format
  • a webhook verification checklist

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.