Why it matters
Attackers who capture a valid signed webhook can replay it. Platforms that include timestamps (Slack) expect you to reject skew; all platforms benefit from idempotent event ids.
Practical steps
- Reject requests whose timestamp is older than ~5 minutes when the platform provides one.
- Store seen event/update ids with a TTL covering the retry window.
- Make handlers safe if a duplicate slips through.
- Alert on verify_ok + duplicate_id spikes.
- Test with a fixture that reuses an id.
Watch out for
- Only checking signatures and ignoring timestamps.
- In-memory replay caches that reset on every deploy.