new row violates row-level security policy (Supabase)
Your insert or update is blocked by RLS. Add a policy for that exact write, without turning RLS off.
Stripe webhook verification failed: wrong endpoint secret, a parsed body, or a bad Stripe-Signature header. Keep the secret server-side.

Verify the webhook with Stripe's helper using three correct inputs: the raw request body, the Stripe-Signature header, and the matching endpoint secret (whsec_...). Stripe documents this exact error when any of the three is wrong (Stripe: Resolve webhook signature verification errors).
// Node example shape from Stripe's docs — keep the secret in server-only env
const event = stripe.webhooks.constructEvent(
requestBody, // raw UTF-8 body string, not parsed JSON
request.headers['stripe-signature'], // full header value
process.env.STRIPE_WEBHOOK_SECRET // whsec_... for THIS endpoint
)
Checklist, in the order Stripe recommends:
stripe listen) print different secrets. Both start with whsec_, but they are not interchangeable. Open the endpoint in Workbench → Reveal secret, or copy the CLI secret, and confirm your env matches (Stripe: Resolve signature errors).express.json() (Stripe: Resolve signature errors).t=...,v1=...,v0=... (Stripe: Resolve signature errors).Only after verification succeeds should you fulfill the event (mark paid, provision access, and so on).
Without verification, anyone who can reach your URL could POST a fake payment_intent.succeeded and trigger side effects. Stripe signs each delivery; your server recomputes the signature with the endpoint secret and compares it (Stripe: Manage webhook endpoints).
The failure message Stripe quotes is:
Webhook signature verification failed. Err: No signatures found matching the expected signature for payload.
The most common cause is the wrong whsec_ secret; the next is a mutated body (Stripe: Resolve signature errors).
whsec_...) or your Stripe secret key (sk_...) in frontend code or public env vars. Keep them server-only (same rule as other provider secrets; see secret key in frontend bundle).My Stripe webhook fails with: No signatures found matching the expected signature for payload.
Check that constructEvent (or equivalent) gets: (1) the raw request body, (2) the Stripe-Signature header, (3) the whsec_ secret for this same endpoint (CLI vs Dashboard).
Ensure JSON body parsing middleware runs AFTER the webhook route.
Keep whsec_ and sk_ keys server-only. Do not put them in VITE_ or NEXT_PUBLIC_ vars.
Show changes first and wait for my OK.
stripe trigger via the CLI with the CLI secret).constructEvent succeeds.Pre-launch checklist · Secret key in frontend bundle · AI provider key leaked
Was it the CLI secret vs Dashboard secret, or a framework that parsed the body first? Tell us which. We'll put that case first next time.
This guide is educational and based on the vendor's public docs as of the review date. Platforms change: check the linked sources. Not a security audit. Disclaimer.
From BuiltSafely · builtsafely.com · https://builtsafely.com/fixes/stripe-webhook-signature/
The BuiltSafely weekly
Platform changes that affect the security of AI-built apps, checked against official docs. Free. Unsubscribe any time.