System Design · Senior · Question 34 of 75
How do you verify the authenticity of an incoming webhook?
- ✓Correct answer: Verify the HMAC signature and timestamp
- 2Check that the request came via POST
- 3Check that the body contains a
verified: truefield
Explanation
The webhook endpoint is public; anyone can call it. The provider signs the body with a secret, and you verify the signature (on the raw body) and the time to reject replays. Everything else is easy to forge.