Transcript
0:00 Is your app open?
In one study, over seven thousand Lovable sites let anyone read email records, no login needed. Some may be test data or public contacts, so it’s not a confirmed rate. Built on Supabase with Lovable or Bolt? Let’s check yours, then fix it without breaking your app.
0:17 Why tables end up open
Your app uses a publishable key, or the older anon key. Every visitor gets it, by design. Row-level security, or RLS, decides which rows each request gets, through rules called policies. Tables made in Supabase’s dashboard get RLS on. Tables made with SQL need you to switch it on.
Lovable’s scan can flag this, even suggest a fix. Checking the rules is still on you.
0:44 Step 1: Get your schema
Open the tool. Pick Check my project. No migration files? That’s fine. Click Copy the query. It reads settings, like policies, grants and Storage buckets, and never the rows in your tables.
In Supabase, open the SQL Editor. Paste, and run. You get one row with one value. Copy all of it. Paste it into Your schema. It checks at once, and what you paste stays in your browser.
1:11 Step 2: Read the board
Headline: one table is open to anyone. The board shows who can reach each table. Out is signed out: anyone with your public key. In is signed in.
Red All rows: every row. Yellow Own rows: only their own. A dash: no access. Profiles has RLS off: anyone can read, add, change and delete every row. Notes has RLS on, with three policies. Yet anyone can read every note, and any signed-in user can change any note.
1:40 Step 3: Findings and fixes
Click a row. You’ll see only its findings. Each one explains the problem. Most come with fix SQL. The warning: the update rule only checks that someone is signed in. Its fix ties each note to its owner.
The note: every note is public. That’s fine for public content. Read each fix, and run it on a test project first.
2:01 Step 4: Generate policies
To set every rule at once, use Generate policies. It doesn’t read your project. You set it up to match your tables. Start from Personal app. Rename the tables and owner columns to match yours.
Click a cell to cycle: no access, Yes for every row, Own for their own. The card shows you the policy it writes, in words and SQL. Should signed-out visitors see something? Set Anyone to Yes.
This SQL removes the old policies on these tables, even the one that let anyone read everything, and grants only what the plan needs.
2:36 Step 5: Run, test, check again
Copy the SQL. Run it in the SQL Editor, on a test project first. Then open Test as each user. Paste in a real user ID, and run one block at a time. Each rolls back. Signed in as Maya, you get only Maya’s profile and note, not Leo’s or Ana’s.
Run the check query again, and paste the new value. Nothing serious found. Signed out, you see nothing. Signed in, you see only your own rows.
3:10 What this check can’t see
One limit: it reads settings, not your app’s code. So it can’t spot a secret key, or the old service role key, in your app. That key skips every rule. Keep it on the server. It’s free, with no sign-up: nestedbit.com, Free tools, Supabase RLS Generator.
Sources
Where the facts in this video come from. Everything shown on screen is a test project with made-up data.