Verify a webhook signature before accepting the event
An incoming webhook is a request from outside your app. Validate its signature before the handler acts on it.
npm install --save-dev @sitecmd/cli
npx sitecmd audit .
The CLI runs on your computer or in your CI, and your code stays there.
What it finds on a demo project
The CLI flags webhook handlers with no signature check, and handlers that change data with no guard against duplicate events.
SiteCMD CLI 2.0.0
Demo project: Inbound webhook endpoint
npx sitecmd audit .
SiteCMD Code Scan - .
Checked: November 9, 2026
Framework: Express
Issues: 2 total | critical 0 | high 1 | medium 1 | low 0
High (1)
- [Security · security] No recognized webhook signature verification in handler - src/routes/webhooks/events.js:9
Medium (1)
- [Security · security] No recognized webhook idempotency guard in handler - src/routes/webhooks/events.js:9
Your code passes? Now watch your site.
Verify webhook signatures using the provider's format
For GitHub deliveries, compute the HMAC from the payload and webhook secret, then check it against
X-Hub-Signature-256with a constant-time comparison. GitHub's verification guide shows its exact format.Clerk sends webhooks through Svix, which signs the message ID, timestamp and raw body together. Svix's verification guide says to leave the body unchanged before verifying and reject timestamps outside your tolerance.
Handle webhook idempotency after checking the sender
A valid event can still arrive more than once. Clerk sends the same svix-id with every delivery attempt for an event. Store the IDs you've handled and skip repeats.
Frequently asked questions
Why can webhook signature verification fail after parsing JSON?
The signature covers the exact bytes the provider sent. Parsing JSON and turning it back into a string can change those bytes. Verify the raw body first, then parse it.
Does webhook signature verification stop a valid event from being processed twice?
No. Clerk can retry an event your endpoint already processed if the response never reaches Clerk.
Follow webhook handling into payments and request limits
Website security
Catch leaked API keys and exposed files before someone uses them against you.
Stripe webhook verification
Confirm each payment event came from Stripe, and keep prices and return URLs on the server.
API rate limiting
Put limits on sign-in, password reset, forms and other public endpoints.