AppSec Architecture··5 min read·By Veer Bhanushali
Auditing Stripe, GitHub, and custom webhook handlers against timing and replay bugs
Parsing JSON before computing HMAC signatures breaks verification or hides cross-tenant integration spoofing across webhook endpoints.
Key takeaway
Verify HMAC-SHA256 against the exact raw Buffer body using crypto.timingSafeEqual, enforce a 5-minute timestamp window, and store nonces.
Always hash the exact unparsed wire body
Re-serializing JSON after middleware parsing changes whitespace and key order, causing signature failures or tempting developers into disabling signature checks on staging/prod.