-
Notifications
You must be signed in to change notification settings - Fork 1
Need to defend against timing attacks #1
Copy link
Copy link
Open
Description
First thank you for taking the time to write the article and put this repo together.
I noticed while reading through your example that currently no secure comparison is being used when comparing the signature passed by GitHub to the signature you have generated. You will likely want to incorporate something like Plug.Crypto.secure_compare/2 in your is_payload_signature_valid?/2 function to avoid the possibility of timing attacks.
Also, you may want to consider hex encoding your payload signature as that is what GitHub is doing. Maybe something like Base.encode16(case: :lower) and I believe the header from GitHub is X-Hub-Signature-256. The X-Hub-Signature uses sha1 instead of sha256.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels