Slack signing secrets and v0 timestamp verification
A Slack app's Request URL receives events, slash commands and interactions. Slack signs each request with the app's signing secret, and the header value is v0= followed by 64 hexadecimal characters.
X-Slack-Signature: v0=8f14e45f... / X-Slack-Request-Timestamp: 1764500000
The body alone is not signed
Slack signs more than the body. It concatenates v0, a colon, the timestamp, a colon and the raw body, then computes HMAC-SHA256. Because the timestamp is inside the signature, changing only the timestamp and resending does not work.
base = "v0:" + timestamp + ":" + raw_body
Verification steps
- Read
X-Slack-Request-Timestampand compare it with the current time. Reject anything older than five minutes (300 seconds). - Read the raw body. Do not parse it yet.
- Build the string above and compute HMAC-SHA256 with the signing secret.
- Strip
v0=and compare in constant time. - Only after that, parse the body and process the event.
Checking the timestamp first rejects old requests before the expensive computation. Do not reveal why a request was rejected; return 401 uniformly.
URL verification and retries
Saving a Request URL makes Slack send a url_verification challenge. That request is signed the same way, so apply the same verification and echo the challenge value.
If Slack does not receive a response it retries and adds X-Slack-Retry-Num. A retry is the same event, so deduplicate by event_id and still return 200 to stop the retry loop.
Common mistakes
- Leaving the timestamp out of the signed string
- Comparing without stripping
v0= - Signing a re-serialised body after JSON parsing
- Using a much longer tolerance than five minutes and opening a replay window
- Returning 200 for both signature failures and processing failures, which stops retries but hides errors
Questions
Where do I find the signing secret?
In the Slack API app settings under Basic Information. The older Verification Token is no longer used for signature verification.
Is five minutes mandatory?
It is Slack's recommendation. Keep 300 seconds as the default to absorb clock skew and latency, and if you extend it, remember the replay window grows.
Do slash commands use the same scheme?
Yes. Events, slash commands and interactions all use the same signing secret and v0 signature.
Compute a v0 signature with a timestamp yourself.
Open the toolThis guide follows the HMAC definition in RFC 2104 and the public webhook documentation of GitHub, Slack and Stripe. Every example value is synthetic.