Free checklist · v1.0, November 2026 · 12 of 28 checks are critical

The 28 checks I run before a Lovable app takes real payments.

Each one has a test you can run yourself in a few minutes. Free. No email required to read it.

Section 1 · 7 checks

Your data: who can read and write it

Most real leaks in AI-built apps are here. The public key in your website lets anyone talk to your database directly, so the database itself has to say no.

  1. Check 01 of 28Critical

    RLS is enabled on every table in the public schema

    Check
    Supabase dashboard → Database → Advisors. Any "RLS Disabled in Public" (lint 0013) error fails this item.
    Fix
    alter table public.<name> enable row level security; then add policies. Never switch RLS off to make an error go away.
  2. Check 02 of 28Critical

    No policy is "using (true)" on data that belongs to someone

    Check
    Run: select tablename, policyname, qual, with_check from pg_policies where schemaname = 'public' and (qual = 'true' or with_check = 'true');
    Fix
    Compare the owner column with (select auth.uid()), or check membership in the row's workspace.
  3. Check 03 of 28Critical

    Two test users in different workspaces cannot see each other's rows

    Check
    Run the free two-user leak test (tools/leak-test), or sign in as user B and open user A's record URLs.
    Fix
    Fix the policy on every table that leaks. Add the two-user test to CI so it stays fixed.
  4. Check 04 of 28Critical

    Users cannot write columns they should not control

    Check
    As a normal user, try to update your own role, plan, is_paid or another user's user_id from the browser console.
    Fix
    Add WITH CHECK to insert and update policies, guard sensitive columns with a trigger or column grants, and move status changes server-side.
  5. Check 05 of 28Critical

    No policy trusts user_metadata

    Check
    select * from pg_policies where qual ilike '%user_metadata%' or with_check ilike '%user_metadata%'; (lint 0015)
    Fix
    Any user can edit their own user_metadata. Keep roles in a table only the server writes, or in app_metadata.
  6. Check 06 of 28High

    Views and SECURITY DEFINER functions do not bypass RLS

    Check
    Advisors lints 0010 (security definer view), 0028 and 0029 (definer functions executable by anon or authenticated), 0002 (auth.users exposed).
    Fix
    Use security_invoker views, revoke execute from anon, check membership inside definer functions, and set search_path = ''.
  7. Check 07 of 28High

    Storage buckets are private unless the files are truly public

    Check
    Dashboard → Storage. Lint 0025 flags public buckets that allow listing.
    Fix
    Private bucket, per-user folder policies, signed URLs for downloads.
Section 2 · 4 checks

Keys and secrets

The anon (publishable) key is meant to be public. Everything else must live only on a server.

  1. Check 08 of 28Critical

    The service_role / sb_secret_ key is not in the frontend bundle or the repo

    Check
    Build the app, then search the output: grep -r "service_role\|sb_secret_" dist/. Decode any eyJ... strings and check the role.
    Fix
    Move admin actions to an Edge Function or server route. Rotate the key if it was ever shipped.
  2. Check 09 of 28Critical

    No secret sits in a VITE_ or NEXT_PUBLIC_ variable

    Check
    List every VITE_ / NEXT_PUBLIC_ variable. Each one is public by definition.
    Fix
    Rename and move to server-side environment variables (Edge Function secrets, Worker secrets).
  3. Check 10 of 28Critical

    OpenAI, Stripe secret and email API keys are only used server-side

    Check
    Search the bundle for sk-, sk_live_, sk_test_, re_, whsec_.
    Fix
    Proxy the call through a function that checks the user, with a per-user rate limit.
  4. Check 11 of 28High

    Old keys from chat history, commits and screenshots are rotated

    Check
    Search git history (git log -p | grep -i key) and your builder's chat log for pasted keys.
    Fix
    Rotate anything that was ever pasted or committed.
Section 3 · 6 checks

Payments (Stripe)

Payment bugs either give your product away or charge people twice. Both are quiet until someone notices.

  1. Check 12 of 28Critical

    The webhook verifies the Stripe-Signature header

    Check
    curl -X POST <your webhook URL> -d '{"type":"checkout.session.completed"}' must be rejected with 400.
    Fix
    Read the raw body (req.text()), call constructEventAsync with your whsec_ secret, then parse.
  2. Check 13 of 28High

    The same event processed twice changes nothing

    Check
    Resend an event from the Stripe dashboard. Count payment rows and emails afterwards.
    Fix
    Store event.id in a table with a unique key before doing any work; skip duplicates.
  3. Check 14 of 28Critical

    Prices and amounts come from your database, not from the browser

    Check
    Replay the create-checkout request with "amount": 1 or "quantity": -1.
    Fix
    Build line items server-side from your products or invoice rows. Ignore client-sent prices.
  4. Check 15 of 28Critical

    The success page does not mark anything as paid

    Check
    Open your success URL without paying. The order must stay unpaid.
    Fix
    Only the verified webhook fulfils orders. The success page just shows status.
  5. Check 16 of 28High

    Fulfilment checks amount, currency and the object it pays for

    Check
    Read the webhook handler: does it compare amount_total and currency with your record?
    Fix
    Compare before marking paid. Log and alert on mismatches.
  6. Check 17 of 28Medium

    Out-of-order and unknown events are handled

    Check
    Does a late subscription.updated after subscription.deleted bring a plan back?
    Fix
    Re-fetch the object from Stripe or compare event timestamps before writing.
Section 4 · 4 checks

Sign-in and authorisation

Hiding a button is not a permission. Every rule has to hold when someone skips your UI.

  1. Check 18 of 28Critical

    Every privileged action is checked on the server or in the database

    Check
    As your lowest role, call admin actions directly (browser console or curl) instead of through the UI.
    Fix
    Check role and ownership in the policy or the server route, not in React.
  2. Check 19 of 28High

    Edge Functions check who is calling

    Check
    Call each /functions/v1/<name> with no Authorization header.
    Fix
    Keep verify_jwt on (except the Stripe webhook) and load the user inside the handler.
  3. Check 20 of 28High

    Login, signup, password reset, email and AI endpoints are rate limited

    Check
    Send 30 requests in a minute. You should see 429s.
    Fix
    Tune Supabase Auth rate limits, add CAPTCHA to signup, and limit your own functions per user and IP.
  4. Check 21 of 28Medium

    Self-signup is off if the app is invite-only

    Check
    Try POST /auth/v1/signup with the anon key even if your UI has no signup form.
    Fix
    Disable signups in Auth settings and invite users from the server.
Section 5 · 5 checks

When real users arrive

The app that worked for ten testers slows down or goes blank for a thousand customers.

  1. Check 22 of 28High

    Every foreign key and policy column is indexed

    Check
    Advisors lint 0001 (unindexed foreign keys). EXPLAIN ANALYZE your main list query and look for Seq Scan.
    Fix
    create index on public.<table> (<fk column>); composite (tenant_id, sort column) for lists.
  2. Check 23 of 28Medium

    Pages load in a few requests, not one per row

    Check
    Open DevTools → Network on your dashboard. Count /rest/v1 calls.
    Fix
    Fetch related rows with one embedded select, or an RPC that returns the page in one query.
  3. Check 24 of 28Medium

    Policies call auth.uid() once per query, not once per row

    Check
    Advisors lint 0003 (auth_rls_initplan).
    Fix
    Write (select auth.uid()) instead of auth.uid() inside policies.
  4. Check 25 of 28Medium

    Errors are caught, shown and logged

    Check
    Turn off your network and click around. A white screen fails this item.
    Fix
    Error boundaries per page, check every { error } from Supabase, and send errors to a logger with a request id.
  5. Check 26 of 28Medium

    Money is stored in integer cents

    Check
    Look for float or double precision columns named amount, price or total.
    Fix
    Use integer minor units (or numeric) and format only for display.
Section 6 · 2 checks

Shipping changes safely

Production needs a way to change the database without guessing, and a place to try it first.

  1. Check 27 of 28High

    Schema changes live in migration files in the repo

    Check
    Is there a supabase/migrations folder that matches production? (supabase db diff should be empty.)
    Fix
    supabase db pull once, then make every change as a migration and apply it with supabase db push.
  2. Check 28 of 28Medium

    There is a separate staging project with its own keys

    Check
    Do your preview deploys write to the production database?
    Fix
    Create a second Supabase project and separate Stripe test keys for staging.

Or let a script try it: one file, free.

The two-user leak test signs in as two of your test accounts, and as a stranger with only your public key, and reports which tables and database functions leak across them. Read-only, it never prints your data, and it only runs against a project you confirm you own.

Folioport before18 critical, 2 high10 tables, 34 requests
Folioport after0 critical, 0 highsame tables, same requests

It refuses service_role keys, caps itself at 200 requests, and exits with code 1 on any critical or high finding, so it can run in CI against staging. It covers tables and database functions; Storage, Edge Functions and webhooks still need a human review.

Download and run it

Create two test users in separate workspaces, give each a record or two, then run:

Download leak-test.mjs17 KB · Node 20+ · nothing to install

SHA-256 (check it with shasum -a 256 leak-test.mjs)e37d63692a0ed0071a2bc2861c80d8f4ff2c6986080e499685aa75cb3b158828

Run it against a project you own
node leak-test.mjs --i-own-this-project \
  --url https://<ref>.supabase.co \
  --anon-key <publishable key> \
  --user-a a@you.dev:pass \
  --user-b b@you.dev:pass

Found more than you want to fix alone?

The Rescue Audit runs all 28 checks against your app, plus the attacks a scanner can't, in 72 hours for $99. I reply within one business day with a start date and a payment link: rescue@jagritvats.com.