Row-level security
Row-level security is a database feature that decides, row by row, who may read, add, change or delete data. In apps built on Supabase or Postgres, it's what stops one user, or anyone on the internet, from reading everyone else's records.
Why it matters
Many AI-built apps talk to the database straight from the browser with a public key. Supabase's documentation says to turn row-level security on for every table in an exposed schema, because a table without it is readable and writable by anyone with access to that schema.1
In 2025 that gap became CVE-2025-48757, recorded as insufficient row-level security policies in apps generated by Lovable that let unauthenticated attackers read or write database tables.2
In practice
- Turn it on for every table, including ones you think are unused.
- Write a policy for each action: read, insert, update, delete.
- Test the site logged out in a private window.
- Read what each policy allows, since one can exist and still let everyone in.
- Repeat the test after every change the AI makes.
What the sources say
Enable RLS on every table in an exposed schema.
Supabase Docs, Row Level Security
What to do about row-level security, depending on who you are
If you built an app with Lovable, Bolt or a similar tool
These tools often use Supabase, which puts a public key in the browser by design. Row-level security is the only thing between that key and your data.
- Open each table in Supabase and confirm RLS is on.
- Check every policy says who can do what.
- Load the app logged out and look for other users' data.
If you're the developer reviewing an AI-built app
CVE-2025-48757 came from policies that were missing or too weak, not from a bug in Postgres. Review what each policy permits.
- List every table and its policies per action.
- Test each policy with an anonymous and a second user's session.
- Add a check to the deploy that fails if a table has RLS off.
Go deeper
My guide to vibe-coded website security covers this check and the other three that matter most before launch.