Stripe webhook signature verification check

Drop your project or paste your webhook route to find Stripe handlers that act on events without verifying the Stripe-Signature header.

Run the check

Drop a project folder or files here

node_modules, .git, virtualenvs and build folders are skipped. Limit 25 MB / 5,000 files.

The Python engine (Pyodide, a few MB, cached by your browser) loads when you start.

The mistake

A webhook handler that reads the event body and acts on it without stripe.webhooks.constructEvent; one that verifies JSON.stringify(req.body) instead of the raw bytes; one that catches a failed verification and carries on; or one that disables the timestamp tolerance.

Why it is dangerous

A webhook URL is public: anyone who finds it (it is in your code, your logs, or simply guessable, like /api/webhooks/stripe) can POST to it. Without a signature check, a forged checkout.session.completed unlocks a paid plan for free. Providers sign the exact bytes they send, so verifying re-serialized JSON fails at random and the usual "fix" is to turn the check off. Stripe signs a timestamp with the body; a tolerance of 0 / None disables replay protection in the SDK.

How to fix it

Verify the signature over the raw request body before reading the event, and return 400 when it fails:

// Next.js App Router
const rawBody = await req.text();
const event = stripe.webhooks.constructEvent(
  rawBody, req.headers.get("stripe-signature"), process.env.STRIPE_WEBHOOK_SECRET);

# Python
event = stripe.Webhook.construct_event(payload, sig_header, secret)

With Express, register express.raw({ type: "application/json" }) on the route before app.use(express.json()). Remember processed event ids, because providers deliver at least once.

What this checker looks for

This page runs webhook-check, which reads route handlers in Next.js, Express, Fastify, Hono, FastAPI, Flask and Django. The rules most relevant to this page:

RuleWhat it finds
WHK001Webhook handler does not verify the signature
WHK002Signature checked against parsed / re-serialized JSON
WHK004Hard-coded webhook signing secret
WHK005Signature verification failure is ignored
WHK007Webhook events are not de-duplicated
WHK008Stripe signature tolerance disabled or very large

Every finding has a rule id, a severity, file:line, the offending line (secrets masked), why it matters and how to fix it. Run webhook-check rules for the full list.

FAQ

Which frameworks are understood?

Next.js (App Router and pages/api), Express, Fastify, Hono, FastAPI, Flask and Django.

Does it check verification done in middleware or another file?

No cross-file analysis. To avoid false alarms, a handler that passes the request to a function from another file is not reported as unverified.

Are my files uploaded anywhere?

No. The checker is Python running inside your browser tab (Pyodide, WebAssembly). Your files are read with the browser's File API and written into an in-memory file system that exists only in this tab. Your files are never sent anywhere. The only network requests load the Python runtime and the checker code, plus Google Analytics page-view counting, which never sees your files. You can disconnect from the internet after the engine has loaded and the scan still works.

Is a clean report a guarantee?

No. It is a static check for known patterns, not a penetration test. A clean report means none of these patterns were found, nothing more.

Can I run the same check on my machine or in CI?

Yes. Every checker on this site is an open-source command-line tool (MIT licence, Python 3.10+ standard library only). The results here are the same as `scan --json` on the command line, except for checks that need git (whether a file is committed or ignored), which cannot run in a browser.