Skip to content
SlashClone
Made by@shipcheck

Stripe webhook hardening

@shipcheck/stripe-webhook-hardening

Find your Stripe webhook handlers and harden them: verify the Stripe-Signature header, use the raw body, keep the signing secret in env, process each event once, reject bad signatures with 400, and fulfill orders from the webhook rather than the success page. Reads your code and proposes diffs; never calls Stripe.

SkillDevOpsv1.0.0 (latest)Tested
Activity
New: be the first to try it
  1. 1# Stripe webhook hardening
  2. 2
  3. 3Finds your Stripe webhook handlers and checks the things that let people fake payments or get credited twice. Then it proposes small diffs for your framework, one at a time.
  4. 4
  5. 5**For:** anyone who added Stripe Checkout or subscriptions to an app, especially with a coding agent's help.
  6. 6
  7. 7## Example
  8. 8
  9. 9Input: a Next.js route that does `const event = await req.json()` and marks the order paid.
  10. 11Output (`out/webhook-scan.md`):
  11. 13```markdown
  12. 14Handlers found: 1 | High: 2 | Medium: 1 | Low: 0
  13. 16## app/api/webhooks/stripe/route.ts
  14. 17| Check | Result | Note |
  15. 18| signature | FAIL (high) | Anyone who finds this URL can post a fake |
  16. 19| | | checkout.session.completed. |
  17. 20| raw-body | FAIL (high) | Reads the body as parsed JSON. |
  18. 21| idempotency | FAIL (medium) | Retries can double up orders or credits. |
  19. 22```
  20. 24Then Claude reads the handler in full, checks things a scan cannot (like access granted on the success page), and shows a diff for each fix. Try it on the bundled example: `node scripts/webhook-scan.mjs examples/project`.
  21. 26## What it checks
  22. 28Signature verification, raw body, signing secret in env, idempotency on `event.id`, 400 on bad signatures, event type filtering, edge runtime support, and fulfillment from the webhook rather than the success page. Works best with Node (Next.js, Express, Supabase Edge Functions); Python, Ruby, Go and PHP handlers are detected with lighter checks.
  23. 30## What it can access
  24. 32- Reads your project's code. Writes the report to `out/`.
  25. 33- Edits handler files in `app/`, `src/`, `pages/`, `server/`, `api/`, or `supabase/functions/`, and adds a migration, only after you say yes to each diff.
  26. 34- No network. It never calls Stripe and needs no keys.
  27. 36## Setup
  28. 38None. Needs Node 22 or later. The Stripe CLI is handy for testing your fixes but not required.