Webhooks Verification.
Last updated
Was this helpful?
Last updated
Was this helpful?
Because of the way webhooks work, attackers can impersonate services by simply sending a fake webhook to an endpoint. Think about it: it's just an HTTP POST from an unknown source. This is a potential security hole for many applications, or at the very least, a source of problems.
In order to prevent it, Lenda signs every webhook and its metadata with a unique key for each endpoint. This signature can then be used to verify the webhook indeed comes from Lenda, and only process it if it is.
Another potential security hole is what's called replay attacks. A is when an attacker intercepts a valid payload (including the signature) and re-transmits it to your endpoint. This payload will pass signature validation and will therefore be acted upon.
To mitigate this attack, Lenda includes a timestamp for when the webhook attempt occurred. Our libraries automatically reject webhooks with a timestamp that are more than five minutes away (past or future) from the current time. This requires your server's clock to be synchronized and accurate, and it's recommended that you use to achieve this.