Book 3 · Lesson 3.8
Slack webhook security
- Verify Slack signing secret before parsing body
- Reject tampered X-Slack-Signature
- Explain replay protection with timestamp
Prerequisites: 3.2
Slack (and similar vendors) prove webhook authenticity with HMAC-SHA256:
v0 = HMAC-SHA256(signing_secret, "v0:" + timestamp + ":" + raw_body)
SlackSignatureVerifier — compute signature, then tamper to see rejection.
Ingestion checklist
- Read raw body bytes (before JSON parse)
- Compare
X-Slack-Signatureconstant-time - Reject if timestamp skew > 5 minutes
Teach-back prompt
Why parse JSON only after signature verification?
Slack signature verify
Lab complete — nice work.