FLYREADYLab

Lovable + Supabase security checklist before launch

Twelve checks, in the order I run them on real apps. Each one says what goes wrong, how to test it yourself in a few minutes, and what the fix looks like.

Database and Row Level Security

1. RLS is enabled on every table in the public schema

Any table without RLS is readable and writable by anyone holding your anon key, and every visitor holds it. In the Supabase dashboard, open Table Editor and look for tables marked "RLS disabled". Turn it on, then add policies.

2. No policy says using (true) for private data

AI builders often generate permissive policies to make the demo work. RLS is "enabled", scanners are happy, and every signed-in user can read every row. Search your migrations for using (true) and with check (true). For user-owned rows, the condition is usually auth.uid() = user_id.

3. Test as two real users, not one

Create user A and user B. Sign in as A and request B's rows directly through the REST API with A's access token. If anything comes back, the policy is wrong. This is the single most valuable test on this page.

curl "https://YOUR_PROJECT.supabase.co/rest/v1/orders?user_id=eq.USER_B_ID" \
  -H "apikey: YOUR_ANON_KEY" \
  -H "Authorization: Bearer USER_A_ACCESS_TOKEN"

4. Updates and deletes have their own policies

A table can block reading other users' rows and still let anyone update or delete them. Check that update and delete policies exist and use the same ownership condition, and that with check stops users from changing user_id to someone else's.

5. Anonymous visitors can't read what they shouldn't

Request each table with only the anon key and no login. You can do this in 20 seconds with the free RLS check, which runs in your browser and shows row counts only.

Keys and secrets

6. The service_role / secret key is not in the browser

The anon or publishable key is meant to be public. The service_role or sb_secret_ key bypasses RLS entirely. Open your deployed site, view the JavaScript bundles in DevTools, and search for service_role and sb_secret. If either appears, rotate the key immediately.

7. Third-party secrets live in Edge Functions or the server

Stripe secret keys, OpenAI keys and email API keys must never ship to the client. Search the bundle for sk_live, sk- and your provider names.

Auth and admin

8. Admin pages are protected on the server, not just hidden

Hiding a menu item is not access control. Sign in as a normal user and type the admin URL directly. Then call the admin API or RPC directly. Both must refuse.

9. Users can't give themselves roles

If roles live in a profiles table, check that a user can't update their own role or is_admin column. This is one of the most common privilege escalations in AI-built apps.

Storage, payments and silent failures

10. Storage buckets aren't public by accident

A public bucket serves every file to anyone with the URL. Keep buckets private unless the files are meant to be public, and add storage policies that match your table policies.

11. Payment webhooks are verified and idempotent

Your webhook handler must verify the provider's signature, and processing the same event twice must not grant access twice. Replay a test event from your provider's dashboard and check the result.

12. Failed writes don't look like success

Open DevTools → Network, submit your main forms, and watch for 4xx responses while the UI says "Saved". An RLS denial on insert often fails silently in generated code.

Want someone to run all twelve for you?

I run these checks on production Next.js + Supabase apps every week. The launch audit covers this list and more, tested as two real users, with proof and the exact fix for each finding. Written report in 48 hours, no calls.