Security
Overview
To ensure that webhook requests originate from Fynapse and have not been tampered with, each request is signed using a shared secret.
Your system must validate this signature before processing any webhook payload.
Why Validation Is Required
Webhook endpoints are public HTTP endpoints. Without validation, an attacker could:
- Send forged requests to your system
- Replay previously captured webhook payloads
- Trigger unintended processing
Signature verification ensures that:
- the request was sent by Fynapse
- the payload has not been modified in transit
Signing Model
Fynapse signs each webhook request using HMAC-SHA256.
The signature is calculated over the following input:
<timestamp>.<raw_request_body>
Where:
timestampis a Unix timestamp (seconds)raw_request_bodyis the exact HTTP request body as received
Signature Header Format
Each request includes a Webhook-Signature header:
Webhook-Signature: t=<timestamp>,v1=<signature>[,v1=<previous_signature>]
Components
t — Unix timestamp used in the signature
v1 — HMAC-SHA256 signature (hex-encoded)
During secret rotation, multiple v1 values may be present. Your system should accept the request if any one of the signatures is valid.
How to Validate a Request
To verify a webhook request:
- Extract the
Webhook-Signatureheader - Parse the timestamp (
t) and allv1signatures - Reconstruct the signing input:
<timestamp>.<raw_request_body> - Compute the HMAC-SHA256 using your secret
- Compare the computed signature with each provided
v1value - Accept the request if any match
Validation Rules
When implementing validation, follow these rules:
Example - Signature Verification (Java)
The following example demonstrates how to validate a webhook signature in Java:
Secret Management
Creating a Secret
A webhook secret is generated by Fynapse and used to sign requests.
- The secret value is returned only when:
- creating a secret
- rotating a secret
- retrieving secret details
- You must store this value securely on your side
Using a Secret
- Each webhook subscription references a secret
- The same secret is used to sign all deliveries for that subscription
Rotating a Secret
Secrets can be rotated to improve security.
During rotation:
- Fynapse may include multiple signatures in the header
- One corresponds to the new secret
- One corresponds to the previous secret
This allows you to:
- deploy the new secret safely
- continue accepting requests during the transition