Why Webhook Security Matters
Without proper verification, anyone could send fake webhook requests to your endpoint, potentially:- Triggering unauthorized actions in your application or bypassing your business logic
- Corrupting your data with false information
- Overwhelming your system with spam requests
How Ultravox Secures Webhooks
Ultravox uses HMAC-SHA256 signatures to ensure webhook authenticity. Each webhook request includes cryptographic proof that:- The request came from Ultravox
- The payload hasn’t been tampered with
- The request is recent (not a replay attack)
Securing Your Webhooks
You can optionally choose to secure your webhooks with a key. When creating a webhook, a secret key is automatically generated for you or you can choose to provide your own secret. You can update or patch your webhooks to change secrets in the event of a leak or as part of regular key rotation. Each time your server receives an incoming webhook from Ultravox here’s how you can ensure the webhook was sent by Ultravox and hasn’t been tampered with:1
Timestamp Verification
- Each incoming webhook request includes a
X-Ultravox-Webhook-Timestamp
header with the time the webhook was sent. - Verify that this timestamp is recent (e.g. within the last minute) to prevent replay attacks.
2
Signature Verification
- Ultravox signs each webhook using HMAC-SHA256.
- The signature is included in the
X-Ultravox-Webhook-Signature
header. - To verify the signature:
- Concatenate the raw request body with the timestamp.
- Create an HMAC-SHA256 hash of this concatenated string using your webhook secret as the key.
- Compare this hash with the provided signature.
Verifying Webhook Signature
3
Multiple Signatures
The X-Ultravox-Webhook-Signature
header may contain multiple signatures separated by commas.- This allows for key rotation without downtime.
- Your code should check if any of the provided signatures match your computed signature.
Testing
During development, you can test your webhook security implementation by:- Creating a test webhook with a known secret
- Manually crafting webhook requests with correct signatures
- Verifying that invalid signatures are properly rejected
- Testing with expired timestamps