X-Webhook-Signature
header with each webhook delivery for authenticity verification. This ensures that webhook events are genuinely from Carbn and haven’t been tampered with.
Signature Format
The header value is a base64 encoded RSA signature:<base64_encoded_signature>
Verification Process
- Extract the signature from the
X-Webhook-Signature
header - Decode the signature using base64 decoding to get signature bytes
- Verify the signature using Carbn’s public key and the raw HTTP request body
Complete HTTP Request Example
Security Best Practices
- Always verify webhook signatures using RSA public key verification
- Use HTTPS endpoints with valid certificates
- Implement idempotency using the
X-Webhook-Event-Id
header - Return 200 status quickly to avoid timeouts
- Store public keys securely (use environment variables)
- Log webhook events for debugging and monitoring
Troubleshooting
Common Issues
- Webhook not receiving events: Ensure webhook is enabled and endpoint returns 200 status
- Signature verification fails: Use raw request body and correct RSA public key
- Duplicate deliveries: Implement idempotency using
X-Webhook-Event-Id
header