Connected infrastructure

Treat a webhook as an untrusted message

Editorial edition · 16 November 2026

The idea

A webhook lets another system notify an endpoint when something changes. The public endpoint receives input from outside its trust boundary. Authentication, replay handling and input limits are therefore part of the message design, not optional finishing work.

Design choice

Verify the sender using the provider's documented signing scheme before acting on the payload. Check timestamps when the scheme supports them, bound body size and record the event identifier. Acknowledge accepted work promptly and process it through a durable queue when appropriate.

Worked example

A document service receives a signed update notification. It verifies the raw request bytes, stores the event once and queues a fetch of the current document. A repeated notification does not trigger duplicate processing.

Before you ship

  • Verify before parsing into trusted state.
  • Test invalid and replayed signatures.
  • Keep signing keys outside source control.

Examples are illustrative. Adapt the checks to your own environment.

Further reading

HTTP Semantics, RFC 9110

Search the library