How to verify webhook signatures correctly: raw body, timing-safe comparison, replay window
FlightByte, a flight status API, sends signed webhooks, and its guide explains how receivers should verify them. Each delivery carries a signature header containing a Unix timestamp and an HMAC-SHA256 value computed over the timestamp and the raw request body. The timestamp is included in the signed material so that captured deliveries cannot be replayed with a fresh time. The signature covers exact bytes, so verifiers must read the unparsed raw body, since re-serialising parsed JSON produces different bytes and causes verification to fail. The guide shows framework-specific approaches for Express, Fastify, and Next.js to preserve the raw payload.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in