TMailr

← All writing

For developers

Webhook signatures, done properly

30 July 2026 · 5 min read

Sign the timestamp with the body

A signature over the body alone is valid forever. Anyone who captures one request can replay it whenever they like. Put a timestamp inside the signed material and reject anything old.

X-TMailr-Signature: t=1785469192,v1=<hmac-sha256 of "{t}.{body}">

The receiving mistakes

And on the sending side

If you accept a URL from a user and then fetch it from inside your network, you have built an SSRF unless you check where it resolves. Block loopback, private ranges, link-local and the cloud metadata address, refuse redirects, and re-check on every attempt because DNS can be repointed after you approved it.

More on for developers