Timestamp Validation
Replay attacks occur when malicious actors intercept legitimate requests and then resends them later to trick your system into performing the same action multiple times. To protect against this form of vulnerability, MeetBit sends anX-Webhook-Timestamp header along with each request.
Whenever your endpoint receives a request, check for the presence of this header. If the value of this header is older than 5 minutes, then disregard the request.
HMAC Signature
The Hash-based Message Authentication Code (HMAC) signature ensures that each webhook request is authentic and hasn’t been altered in transit. By using a shared secret to generate the signature, your system can verify that the payload truly comes from MeetBit and remains intact. MeetBit sends anX-Webhook-Signature header along with each request.
Compare the value of this header with an HMAC signature that your system independently computes. If the values don’t match, then disregard the request.
Computing the HMAC Signature
The HMAC Signature is computed by using the destination secret to hash (sha256) a concatenated string composed of the Webhook ID (from the header), ISO8601 timestamp (from the header), and the JSON-encoded body of the request.Example String to Hash
Take note of the period (
.) character in between each segment of the string above.