Turn on RLS in a Lovable + Supabase app
CVE-2025-48757: 170 Lovable apps with missing RLS · Security incident · Web · mattppal · May 29, 2025
What happened
Two researchers scanned 1,645 showcased Lovable apps and found 303 Supabase endpoints in 170 projects readable or writable without login, exposing emails, payment details and API keys.
How to prevent it
Turn on RLS with ownership-based policies for every table, then try unauthenticated reads yourself.
Fix prompt for your own AI tool
Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.
My app uses Supabase (or Firebase) and I built it with Lovable. Please check whether my database is open to anyone. 1) List every table and storage bucket and whether Row Level Security (or security rules) is enabled. 2) For each table, explain who can read and write it now, in plain English. 3) Propose the minimum policies so users only see their own rows, public content is read-only, and plan, role or credit columns can't be changed by users. 4) Give me the SQL or rules to apply, and a test with two accounts and a logged-out browser. Don't use or ask for the service_role key. Don't change anything until I've approved your plan. Never ask me to paste API keys, passwords or .env contents; tell me where to check them myself.
Why this keeps happening: open database rules
Apps built on Supabase or Firebase talk to the database straight from the browser with a public key. Without row-level security or security rules, anyone with that key can read or change every row.
A quick checklist before you ship
- Turn on row-level security for every table and add explicit policies.
- Test with a second account and with no account at all.
- Never expose the service-role or admin key to the browser.
- Check which columns a user can update, so nobody can change their own role or plan.
More on this: every open database rules story and our related guide.
Tools involved
Lovable stories, Supabase stories
Related stories
- Open your Lovable app logged out, query each Supabase table with the public anon key, and turn on Row Level Security with owner-only policies for anything that comes back
Crissy Field: 7,403 Lovable sites returned tables with email addresses to anyone, no login needed - Check your repo for committed .env files and open tables
Scan of 25,000 AI-built repos: Bolt leaked most, Lovable led on committed .env files - Close an open Supabase database
16,000+ Supabase databases exposed through vibe-coded apps
Source: original post on Web ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.