Debug Ninjas
Payments24 Sept 2026 · 3 min read

A missing Stripe check lets anyone mark an order as paid

If your app trusts the browser to say a payment worked, anyone can skip paying. Confirm payments with a verified Stripe webhook.

Admin

Founder, Debug Ninjas

Your checkout works. Customers pay, they land on a "thanks" page, and their account gets upgraded. But in many apps we review, the upgrade does not actually depend on the payment. It depends on the customer reaching the thanks page. Those are not the same thing.

The pattern that causes it

A typical AI-generated Stripe setup looks like this:

  1. 01The user clicks Upgrade and goes to Stripe Checkout.
  2. 02After paying, Stripe sends them back to a success URL such as /success?plan=pro.
  3. 03The success page runs code that says "set this user to Pro."

The problem is step 3. Anyone can type that URL into their browser without paying. Some apps go further and let the browser send "payment complete" straight to the database, which is just as easy to fake.

The success page should only ever say thank you. It should never be the thing that grants access.

How Stripe expects it to work

Stripe tells your server directly when a payment succeeds, using a webhook. A webhook is a message Stripe sends from its servers to a URL on your server, such as /api/stripe/webhook.

The safe flow is:

  1. 01The user pays on Stripe Checkout.
  2. 02Stripe sends a checkout.session.completed event to your webhook.
  3. 03Your server verifies the signature on that message, so it knows the message really came from Stripe.
  4. 04Only then does your server upgrade the account.

Step 3 matters as much as the webhook itself. A webhook that does not check the signature can be faked just as easily as a success URL. Stripe signs every webhook with a secret that starts with whsec_, and its libraries include a function that checks it for you.

How to check your own app

  • Find the code that upgrades a user or marks an order as paid. Is it on the success page, or in a webhook?
  • If there is a webhook, look for a signature check, such as stripe.webhooks.constructEvent in Node.
  • Open the Stripe dashboard, go to Developers and then Webhooks, and confirm an endpoint exists for your live site, not just for testing.
  • Try it: as a logged-in free user, visit the success URL directly. If your plan changes, you have the bug.

How to fix it

  1. 01Move the upgrade into a webhook handler on your server.
  2. 02Verify the signature on every incoming event and reject anything that fails.
  3. 03Handle the events you rely on, usually checkout.session.completed for one-off payments, and subscription events such as customer.subscription.updated and customer.subscription.deleted for plans that renew or get cancelled.
  4. 04Make it safe to run twice. Stripe may send the same event more than once. Record which events you have processed so a user is not credited twice.
  5. 05Test it locally with the Stripe CLI, which can forward real test events to your machine.

What it costs if you skip it

Lost revenue is the direct cost, but it is also hard to see. People who skipped payment look exactly like paying customers in your app. You only find out when you reconcile your Stripe balance against your user list and the numbers do not match.

The short version

  • A success page is not proof of payment.
  • Grant access only from a webhook, and always verify the webhook's signature.
  • Handle renewals and cancellations, not just the first payment.

Payment flows are one of the areas we test hardest in a Ninja Audit, because mistakes here cost money every day. Book an Audit and we will check your checkout end to end.

Written by Admin

Founder of Debug Ninjas. Has audited dozens of AI-built apps and still double-checks who can see what data.

One useful fix a month.

Field Notes in your inbox. No spam, unsubscribe anytime.