Why Webhook Security Matters
Without proper verification, attackers could:- Send fake webhook requests to trigger unwanted actions
- Modify payload data to manipulate your application
- Overload your webhook endpoint with requests
How Firecrawl Signs Webhooks
Firecrawl signs every webhook request using HMAC-SHA256 encryption with your account’s secret key. This creates a unique signature for each request that proves:- The request came from Firecrawl
- The payload hasn’t been modified
Finding Your Secret Key
Your webhook secret is available under the Advanced tab of your account settings. Each account has a unique secret that’s used to sign all webhook requests.Keep your webhook secret secure and never expose it publicly. If you believe
your secret has been compromised, regenerate it immediately from your account
settings.
Signature Verification
How Signatures Work
Each webhook request includes anX-Firecrawl-Signature
header with this format:
Copy
Ask AI
- Take the raw request body (JSON string)
- Create HMAC-SHA256 hash using your secret key
- Convert to hexadecimal string
- Prefix with
sha256=
Implementation Examples
Copy
Ask AI
Step-by-Step Verification
- Extract the signature from the
X-Firecrawl-Signature
header - Get the raw request body as received (don’t parse it first)
- Compute HMAC-SHA256 using your secret key and the raw body
- Compare signatures using a timing-safe comparison function
- Only process the webhook if signatures match
Security Best Practices
Always Validate Signatures
Never trust a webhook request without signature verification:Copy
Ask AI
Use Timing-Safe Comparisons
Standard string comparison can leak timing information. Use dedicated functions:- Node.js:
crypto.timingSafeEqual()
- Python:
hmac.compare_digest()
- Other languages: Look for “constant-time” or “timing-safe” comparison functions
Require HTTPS
Always use HTTPS endpoints for webhooks:Copy
Ask AI
Copy
Ask AI