The double standard of webhook security and API security
Blog post from Speakeasy
Webhook security often involves higher security standards than traditional API requests, despite both being forms of HTTP requests between servers. While 80% of API producers sign webhook requests with HMAC-SHA256 to verify authenticity, this practice is not as common for API requests, which typically rely on API keys. The benefits of signing requests include reduced risk of secret leakage, replay protection, and request integrity assurance. Although some major players like Amazon, Azure, and Oracle sign their API requests, many opt for API keys due to their simplicity and herd mentality. Webhooks receive heightened security treatment because they often involve untrusted URLs, have a historical precedent for signing, and sometimes use non-HTTPS connections, which signing helps protect. Despite the complexity and performance overhead of implementing signed requests, they provide valuable security layers, aligning with best practices in the industry.