The header
The signed message is the timestamp, a full stop, then the raw request
body:
whsec_ secret and compare the result to v1.
Two checks, not one
Compare in constant time. A normal string comparison returns as soon as it finds a mismatched byte, and that timing difference is enough to recover a valid signature one byte at a time. Reject an old timestamp. The timestamp is inside the signed message, so it cannot be altered without breaking the signature. That is what makes a replay detectable: a captured delivery keeps its originalt forever. Five minutes is
a reasonable tolerance.