Skip to content
Preptima
hardDesignScenarioConceptMidSeniorStaff

You are accepting webhooks from two hundred partners. Threat model the ingestion pipeline - what are you actually defending against, and what does the endpoint have to do before it trusts a payload?

The endpoint is an unauthenticated internet-facing entry point that writes to your core systems, so treat every field as attacker-controlled. Verify an HMAC over the raw body in constant time, reject stale timestamps, deduplicate on event id, bound the body size, and hand off to a queue rather than processing inline.

4 min readUpdated 2026-08-16Target archetype: Big Tech, Fintech, Product Startup

Answer

Short answer

A webhook endpoint is an unauthenticated door on the public internet that writes into your core systems, and anyone who learns the URL can knock on it. Everything in the request is attacker-controlled until a signature proves otherwise. The ordered requirements are: verify an HMAC over the raw body in constant time, enforce a timestamp window, deduplicate on event id, cap the body size, and get off the request thread before doing real work.

Was this answer helpful?

Likely follow-ups

  • Why must the signature be computed over the raw body rather than the parsed object?
  • A partner replays a valid signed request from an hour ago. What stops it?
  • Your handler takes four seconds and the partner times out at three. What goes wrong?
  • The payload contains an account id. Do you trust it, and what do you check?
  • How would you roll a partner's signing secret without downtime?

Related questions

Further reading