Your Supabase app is only as safe as its Row Level Security. Your site ships with a public key, so anyone can send requests to your database with it.2 If a table has no Row Level Security, or a rule that lets everyone through, anyone can read it. Check that first, on every table.
This is the leak behind the best-known case so far. In 2025, CVE-2025-48757 described apps generated by Lovable whose database rules let "remote unauthenticated attackers" read or write their tables.15 Lovable disputed it, on the grounds that each customer is responsible for protecting their own app's data. Whoever is right, the lesson for you is the same: the rules on your database are your job.
This guide is for founders who built an app on Lovable, Replit, Bolt or with Claude Code, with Supabase behind it, and want to know it is safe before real customers sign up. You do not need to be a developer. Each check says what it means, where to click and what a good result looks like. Every Supabase, Lovable and Replit fact comes from their own docs, checked December 3, 2026.
First, know your two keys
Every Supabase project has two kinds of keys, and the whole checklist depends on telling them apart.2
- The public key. Called the publishable key (it starts with
sb_publishable_) or, on older projects, the anon key. Your website needs it to talk to Supabase, so it sits in your site's code where anyone can see it. Supabase says it is safe to expose, as long as Row Level Security is on.4 - The secret key. Called the secret key (it starts with
sb_secret_) or, on older projects, the service_role key. It skips every Row Level Security rule you have.2 Whoever holds it can read and change everything. Supabase is blunt about it: "Never put one in a browser, a shipped application, or source control."
You find both in the Supabase dashboard under Settings, then API Keys. The older keys are long strings that start with eyJ, and the anon and service_role keys look almost the same at the start, so compare the end of the key when you check which one you are looking at.
Check 1: Row Level Security is on for every table
Row Level Security (RLS) is a set of rules on each table that decides which rows a request may see or change. Think of it as a filter added to every request: "only rows where the owner is the person asking." With RLS on and no rules yet, the public key gets nothing back.1 With RLS off, the public key can reach the whole table.3
Do not assume it is on. Supabase turns it on by default only for tables created in its dashboard. Tables created in the SQL Editor or by other tools need it turned on by hand.3 AI app builders and coding agents often create tables with SQL, so check every one.
The quickest check: open your project in Supabase, go to the SQL Editor, and run these two queries. They only read; they change nothing.
In the first result, every table should show rowsecurity as true. Any false is a table the public key can reach. Turning it on is one line per table, alter table public.your_table enable row level security;, but do it with whoever built the app: once it is on, any part of the app that has no matching rule stops getting data.
Check 2: the rules actually restrict access
RLS being on is not enough. A rule that says "true" lets every request through, which is the same as having no lock at all. Look at the second query's result, one row per rule:
- qual is "true". The rule allows every row. On a table with customer data, that is a leak. Supabase's own checker flags these as permissive policies.5
- roles is anon or public. The rule applies to people who are not signed in. A rule with no role named applies to everyone, signed in or not.1 Fine for a public product list, wrong for orders or messages.
- roles is authenticated, with "true". Any signed-in user sees every row. If anyone can sign up for your app, that means anyone can read the table after a free sign-up.
- What good looks like. The rule compares the row's owner to the person asking, using
auth.uid(), for example(select auth.uid()) = user_id. Supabase warns against adding "or auth.uid() is null", which exposes every row to people who are not signed in.1
A plain test anyone can do: create two test accounts in your app. Add some data as the first one. Sign in as the second and see whether anything from the first shows up, in the app or in the outsider test below.
One more thing to know: database views (saved queries that look like tables) skip RLS by default unless they are set up not to.1 The Supabase Security Advisor, further down, flags these.
Check 3: the secret key is not in your site or your code
Anything your website loads, a visitor can read. Supabase lists web pages among the places where a key is "bundled in source code."2 So the secret key must only live on a server: in an edge function's secrets, or in your hosting provider's settings. Here is how to check your live site, in Chrome:
- Copy the last 10 characters of your secret key from Settings, then API Keys. The end is unique; the start of older keys is the same for every key.
- Open your live site, right-click, choose Inspect, then open the Sources tab.
- Search all files with Cmd+Option+F on a Mac or Ctrl+Shift+F on Windows. Paste the 10 characters, then search again for
sb_secret_andservice_role. - Nothing found is the good result. If the site uses the newer keys, you should find
sb_publishable_. That one is meant to be there.
Then check the code itself, including its history: a key that was committed once and deleted later is still in the git history. If you have the project in Claude Code or another coding agent, paste this:
Found it? Rotate the key. Fix how it leaked, create a new secret key under Settings, then API Keys, move every part of the app to it, then delete or deactivate the old one.6 Parts that still use the old key stop working until you switch them, so do it in that order. Supabase also rejects secret keys sent from a browser, but that does not stop someone who copied the key and uses it from anywhere else.2
Check 4: test your app like an outsider
This is the most convincing check, because it is exactly what a stranger would do. You ask your database for data using only the public key, the one anyone can copy from your site. Only run it against your own project.
You need three things: your project URL (in the dashboard under Integrations, then Data API), your public key (Settings, then API Keys) and a table name (from the Table Editor).2 Then open Terminal on a Mac, or PowerShell on Windows, and run:
Replace the three capitalised parts with your own values. This is a read: it asks for five rows and changes nothing. What comes back tells you where you stand:
| You get back | What it means |
|---|---|
| A list of rows | Anyone on the internet can read this table. Fix it today. |
| An empty list: [] | Good, if the table really has rows. Row Level Security is blocking the public key. |
| An error such as "permission denied" | Good. The public key is not allowed to touch this table at all. |
The public key goes in the apikey header, as Supabase's API keys page says.2
Run it for every table that holds anything private: users, profiles, orders, messages, payments, files. Reading is the safe test. Testing whether a stranger can also write or delete is worth doing too, but on a copy of your project, not on the one with your customers in it.
Check 5: storage buckets are private where they should be
Uploaded files (profile photos, invoices, documents) live in Supabase Storage, in folders called buckets. Each bucket is public or private:7
- Public bucket. Anyone with a file's link can open it, no sign-in needed. Fine for product images and logos. Wrong for anything a customer uploaded about themselves.
- Private bucket. Every download is checked, either against the signed-in user or with a link that expires. Buckets are private by default.
Open Storage in the dashboard and look at each bucket. For private ones, the access rules are the same kind of RLS rules as for tables, written on Supabase's storage.objects table.8 Check them the same way: does a rule say "true", or does it tie each file to its owner? In a public bucket, uploads and deletes are still checked against those rules, so a public bucket with a loose rule can let strangers upload or delete files too. Supabase's checker also flags public buckets whose rules let anyone list every file in them.5
Check 6: sign-in settings
These live under Authentication in the Supabase dashboard. Four to look at:
- Confirm email. When it is on, new users must click a link in their email before they can sign in. When it is off, Supabase treats every email as confirmed, so someone can sign up with an address that is not theirs.9 It sits in the Email provider settings.
- Who can sign up. If the app is only for your team or invited customers, turn off "Allow new users to sign up" so only existing users can sign in.9 If you allow anonymous sign-ins, know that those visitors count as signed in, so any rule written for signed-in users applies to them too.1
- Site URL and Redirect URLs. Under URL Configuration. These decide where sign-in and password reset emails send people. The Site URL should be your real domain, not
localhost, and Supabase recommends exact addresses in production instead of wide patterns with**.10 - Leaked password protection. Supabase can refuse passwords that already appeared in known data leaks, using the HaveIBeenPwned list. It is on the Pro Plan and above, in the Auth settings.11
Check 7: edge functions and their secrets
Edge functions are small pieces of code that run on Supabase's servers: sending emails, taking payments, calling an AI service. This is the right place for secret keys, and also a place where things go wrong.
- Secrets go in Edge Function Secrets, not in the code. Set them in the dashboard or with
supabase secrets set. Local.envfiles belong in.gitignore: a committed.envexposes every secret in it.12 - Functions use the secret key, so they must check who is asking. Inside a function, the service role key skips every RLS rule.12 A function that takes a user ID from the request and returns that user's data, without checking the caller is that user, undoes all your rules.
- Look for verify_jwt = false. By default a function only runs for requests with a valid sign-in token. Turning that off "will allow anyone to invoke your Edge Function."13 It is normal for payment webhooks, such as Stripe's. For anything else, ask why it is off, and make sure the function checks the request itself.
Logs are another place secrets slip out: a function that logs a whole request can write a token or an email address into a log. Redact sensitive data in Claude Code covers keeping them out of what your coding agent reads.
Run the built-in checkers: Supabase, Lovable and Replit
Both are free to run and catch the common mistakes in a minute. Run them first, fix what they find, then do the manual checks above, because neither covers everything.
- Supabase Security Advisor. In the dashboard under Advisors, then Security Advisor.5 It flags tables in the public schema with RLS off (shown as a table that is publicly accessible), rules that are always true, sensitive-looking columns exposed without RLS, views that skip RLS, risky database functions, and public buckets that allow listing. Some findings can be on purpose, so read each one. What it does not do: look at your website's code. It will not tell you the secret key is in your frontend; that is Check 3.
- Lovable's security checks. If you built on Lovable, open More, then Security, in the project toolbar.14 Automatic checks run before you publish and cover database rules, leaked password protection and vulnerable dependencies. You can also start deeper checks of the code, covering sign-in, permissions, private data, keys, user input and payments. Lovable's own docs are honest about the limit: the checks "can't guarantee that your app is secure" or replace a full security review.
- Replit's security scan. If you built on Replit, open Security Center from the Tools pane, or select Review security when you publish, then Run scan with Agent.16 It reviews the whole codebase and lists findings you can send to Agent to fix. Replit says the same as Lovable: "A scan is not a complete security review." It needs a paid Replit plan.
Paying someone on Upwork to review it: what to ask for
Plenty of founders post a job like "review my Supabase app so it is safe to release." That is a reasonable thing to buy, if you know what a good review covers. Ask for:
- The scope, in writing. At least everything in this guide: RLS on every table, the rules themselves, the keys in the site and the code history, the outsider test, storage, sign-in settings and edge functions. Ask what they will not look at, such as payments or the app's own code.
- Proof, not opinions. For each finding: what they did, what came back, how serious it is, and the exact fix. "A stranger could read the orders table with the public key" with the request that showed it is worth more than a score.
- Testing that is safe for your customers. Writes and deletes on a copy of the project, not on production.
- A retest. After you or your developer fix things, they check again.
- Access done right. Do not send your Supabase password or your secret key in a chat. Invite them to the project with the lowest access that lets them do the job, and remove it when they are done. A reviewer who asks for your secret key over messages is a warning sign.
Run the built-in checkers yourself first. Then you pay for the part that needs a person, not for findings a free tool already shows.
After launch: security is not one and done
Every new feature adds tables, rules and functions. A new table made by your coding agent can arrive with RLS off. So run the Security Advisor again after every big change, and redo the outsider test on any new table with private data.
You also need to know when something in production breaks or behaves oddly: sign-ins failing, a function throwing errors, a page that suddenly slows down. Most founders only hear about it when a customer writes in. Who tells you at 2am that customers can't log in? walks through that problem.
That is where Fixter (fixter.dev) fits. To be clear, Fixter is not a security tool: it does not review, audit or test your app's security. What it does: Fixter finds and fixes the issues in your app in production, from your coding agent: errors, failing infrastructure, slow requests and downtime. It tells you what broke and why, by email or Slack. And if you want your app off Lovable or Replit and onto accounts you own, we do that move too: see Lovable to Claude Code and Replit to Claude Code.
Key takeaways
- The public key is in your site by design; Row Level Security is what protects your data
- Turn RLS on for every table, and make sure no rule on private data says "true"
- The secret (service_role) key must never be in your site or your git history
- Test with the public key like a stranger would: rows back means a leak
- Private buckets for customer files, Confirm email on, exact redirect URLs
- Run the Supabase Security Advisor (and Lovable's checks) after every big change
Frequently asked questions
Is it safe to have the Supabase anon key in my website?
Yes, that is what it is for. Supabase calls the publishable key (and the older anon key) safe to expose, but only when Row Level Security is on and your policies are right. The key is public by design. Your policies are what keep the data private.
Is Row Level Security on by default in Supabase?
Only for some tables. Supabase says tables created through the Supabase dashboard have it enabled by default. Tables created in the SQL Editor or by other tools need it turned on by hand. AI app builders often create tables with SQL, so check every table yourself.
What do I do if my Supabase service role key leaked?
Rotate it. Fix how it leaked first, create a new secret key under Settings, then API Keys, move every part of your app to the new key, then delete or deactivate the old one. Parts that still use the old key stop working until you switch them, so plan the order. If the key is being used against you right now, turn it off at once.
Does Lovable's security check make my app safe to launch?
It helps, but Lovable itself says its checks can't guarantee that your app is secure or replace a full security review. Run it, fix what it finds, and then do the manual checks in this guide, especially the outsider test with your public key.
Does the Supabase Security Advisor catch everything?
No. It checks your database setup: tables without Row Level Security, policies that let everyone through, exposed views and functions, listable storage buckets. It does not look at your website's code, so it will not tell you a secret key ended up in your frontend.
Should I hire someone to review my Supabase app?
If your app holds personal data, payments or anything private, a second pair of eyes is worth it. Ask for a written report that lists each finding, how they proved it, how serious it is and how to fix it, plus a retest after you fix things. Never hand over your secret key or your account password to get it done.
Sources (16), all checked December 3, 2026
- Supabase docs, Row Level Security (how policies work, no data through the API until you add policies, auth.uid(), the anon and authenticated roles)
- Supabase docs, API keys (publishable and secret keys, legacy anon and service_role, secret keys bypass Row Level Security, never in a browser or source control, Settings > API Keys)
- Supabase docs, Securing your API (Row Level Security on every exposed table, dashboard tables have it on by default, tables made elsewhere do not)
- Supabase docs, Secure your data (the publishable and anon keys are safe only with Row Level Security; secret keys are never safe to expose)
- Supabase docs, Database advisors (the Security Advisor and the checks it runs, including RLS disabled in public and permissive policies)
- Supabase docs, Rotate a leaked or compromised API key
- Supabase docs, Storage buckets (public and private buckets, private by default)
- Supabase docs, Storage access control (policies on storage.objects, no uploads without policies)
- Supabase docs, Auth general configuration (Confirm email, Allow new users to sign up, anonymous sign-ins)
- Supabase docs, Redirect URLs (Site URL, the allow list, exact URLs in production)
- Supabase docs, Password security (leaked password protection with HaveIBeenPwned, Pro Plan and above)
- Supabase docs, Edge Function secrets (setting secrets, keep .env files out of git, the service role key never in a browser)
- Supabase docs, Edge Function configuration (JWT check on by default, verify_jwt = false lets anyone call the function)
- Lovable docs, Security (More → Security, automatic checks before you publish, what the checks cover and what they cannot guarantee)
- NIST National Vulnerability Database, CVE-2025-48757 (Row Level Security in apps generated by Lovable, published May 30, 2025)
- Replit docs, Agent security scans (Security Center, Review security in the publish flow, Run scan with Agent, not a complete security review, paid plans)