Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Webhook Receiver Hardening: Signatures, Replay, Idempotency

    1

    Make Stripe, GitHub, Shopify and other webhooks safe: raw-body signature checks, replay protection, process-once, fast acks, tested. SECURE / FRAGILE / SPOOFABLE.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Webhook Receiver Hardening: Signatures, Replay, Idempotency

    Webhook Receiver Hardening: Signatures, Replay, Idempotency

    Example session with this skill installed

    Audit our webhook handlers. Next.js App Router on Vercel. /api/stripe/webhook handles checkout.session.completed and invoice.paid, /api/github/webhook handles push. Some customers got their credits twice last week.

    • Read your context and instructions
    • Compiled the webhook receiver hardening

    Webhook receivers: app — VERDICT: SPOOFABLE

    Endpoints

    RouteProviderVerificationIdempotencyAck time
    /api/stripe/webhookStripeconstructEvent on JSON.stringify(await req.json())none2.8 s
    /api/github/webhookGitHubnonenone0.3 s

    Findings

    #SeverityEndpointIssueEvidenceFix
    1CriticalgithubNo signature check: anyone can POST a fake push and trigger a deployapp/api/github/webhook/route.ts:8verify X-Hub-Signature-256 with timingSafeEqual on await req.text()
    2HighstripeVerifies re-serialized JSON; fails intermittently, which is why someone added a SKIP_VERIFY env flagroute.ts:14, route.ts:9verify on await req.text(); delete SKIP_VERIFY
    3Highstripeinvoice.paid adds credits with +=; Stripe delivers at least once, so a redelivered event added credits twicelib/billing.ts:41webhook_events table keyed on event.id + set credits from the invoice, not increment
    4MediumstripeEmail and PDF generated inlineroute.ts:30-58store event, return 200, process in a job
    5LowbothUnknown event types return 500route.ts:61return 200 and ignore

    Tests (7/7 pass after fixes)

    Valid Stripe event → 200, processed once · same event twice → processed once · one byte changed → 400 · timestamp 10 min old → 400 · GitHub without signature → 401 · handler throws → 500, retryable · unknown type → 200. Ack time 2.8 s → 90 ms.

    Runbook

    Rotate secrets in Stripe and GitHub settings, update Vercel env vars, redeploy. Find the double-credited customers with the query in scripts/find-double-credits.sql (read-only) before correcting balances.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    A webhook endpoint is a public URL that marks orders paid, grants access or deletes data. If it skips signature checks anyone can call it. If it verifies against re-serialized JSON, verification breaks or can be bypassed. If it is not idempotent, provider retries charge, email or provision twice. If it does slow work inline, the provider times out and retries again.

    This skill gives your coding agent a hardening procedure and a reference file of provider signature schemes checked against official docs. It:

    • Inventories every webhook route: provider, events, what each changes, body parser, secret location
    • Checks 12 items per endpoint: signature on every request, raw body (with the exact fix for Express, Next.js, Fastify, NestJS, Django, Flask, FastAPI, Rails, Laravel, Go and serverless), constant-time compare, timestamp tolerance, event-ID dedupe, fast ack, ordering, status codes, secret rotation, unknown events, exposure and replay runbook
    • Covers Stripe, GitHub, Shopify, Slack, Paddle, Twilio, HubSpot and the Standard Webhooks spec (Svix and many SaaS APIs)
    • Fixes spoofing first, then double or missed processing, then speed and observability
    • Tests it: valid, duplicate, tampered, stale, unsigned, failing and unknown events
    • Returns a verdict: SECURE, FRAGILE or SPOOFABLE

    Who it is for: SaaS and e-commerce developers taking payments, GitHub App and integration builders, and anyone whose webhook handler "mostly works".

    Safety: uses the provider's official verification helper where one exists, never disables verification, never logs secrets, and only sends test events to local or staging.

    Honesty note: it only reports tests it actually ran, and tells you to confirm provider details against current docs.

    Cannot perform live redelivery from provider dashboards. Requires access to framework-level middleware config to verify raw body handling. Does not store or rotate secrets directly.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 28 days ago

    Requires

    Your web framework

    Permissions

    Network Access
    Listed28 days ago

    What's inside

    Frequently Asked Questions

    The skill identifies and fixes critical security flaws like signature spoofing (using raw body verification) and reliability issues like idempotency failures, which prevent duplicate processing of the same event.

    A SKILL.md with the hardening procedure, the 12-point checklist and verdict rules, plus a reference file with signature schemes for Stripe, GitHub, Shopify, Slack, Paddle, Twilio, HubSpot and Standard Webhooks, raw-body handling for each major framework, constant-time compare functions and an idempotency table pattern. Your agent produces the findings table, code diffs, tests and a runbook.

    Yes, it is specifically designed to fix 'Invalid Signature' errors by auditing how your middleware handles the raw request body versus parsed JSON, a common point of failure in modern frameworks.

    Raw-body handling is covered for Express, Next.js, Fastify, NestJS, Django, Flask, FastAPI, Rails, Laravel, Go and AWS serverless. Providers covered: Stripe, GitHub, Shopify, Slack, Paddle, Twilio, HubSpot and any service using the Standard Webhooks spec. For other providers your agent follows the same checklist using that provider's documented scheme.

    The skill requires access to your routing configuration and middleware setup to analyze how the request lifecycle manages the raw byte-for-byte payload.

    Unlike generic prompts, this skill uses a specialized 12-point hardening checklist tailored to specific provider retry behaviors and strict cryptographic comparison requirements.

    New in APIs & Backend