The most “standard” way of generating a signature for a web hook callback request is to hash the payload that’s being sent, together with a secret, and have the receiving party do the same process and compare if the signature in the header coincides with their result.

My question is: why do we need to hash the payload? Is there any security benefit of doing this?

Why can’t we just send them another value in the headers instead of having them have to figure out a way to hash a potentially complex object in such a way that’s compatible across multiple programming languages?

i.e. Would there be a security vulnerability in sending for example, a random string in the headers + the signature in a separate field in the header, and have the receiving party hash the random string with the secret and check if the result coincides?

Share This Discussion

Leave a Comment

Note: By filling this form and submitting your commen, you acknowledge, agree and comply with our terms of service. In addition you acknowledge that you are willingly sharing your email address with AiOWikis and you might receive notification emails from AiOWikis for comment notifications. AiOWiksi guarantees that your email address WILL NOT be used for advertisement or email marketting purposes.

This site uses Akismet to reduce spam. Learn how your comment data is processed.