Verify before parse side effects
- Read the raw body bytes.
- Verify signature (HMAC or Ed25519) with a constant-time compare.
- 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.