BotNetwork

Webhook security deep dive: signatures, replay, SSRF and timeouts

A public HTTPS URL will receive hostile traffic. Authenticate every request.

Guide1 min readUpdated

Verify before parse side effects

  1. Read the raw body bytes.
  2. Verify signature (HMAC or Ed25519) with a constant-time compare.
  3. Then JSON.parse.

Reformatting JSON before verification breaks signatures.

Replay

Slack documents rejecting requests whose timestamp is older than five minutes. Apply a similar window wherever the platform signs a timestamp.

Dedup

Platforms retry. Store processed update ids with a TTL and ignore duplicates.

SSRF

If a bot fetches a URL from user input (unfurl, link preview, webhook forward), block link-local, private and metadata IPs (including cloud metadata 169.254.169.254).

Timeouts

Acknowledge within platform deadlines, then do slow work asynchronously.

Tools

Related comparisons and tools