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

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.

  1. Open each table in Supabase and confirm RLS is on.
  2. Check every policy says who can do what.
  3. Load the app logged out and look for other users' data.

Vibe-coded website security

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.

  1. List every table and its policies per action.
  2. Test each policy with an anonymous and a second user's session.
  3. 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.

Vibe-coded website securityAll 106 terms

Sources

  1. "Row Level Security," Supabase Docs. supabase.com
  2. "CVE-2025-48757," National Vulnerability Database, NIST, published 29 May 2025. nvd.nist.gov

Related terms

Hardcoded secret

A hardcoded secret is a password, API key or access token written directly into a site's code or files. If that code reaches a browser or a public repository, anyone can copy the secret and use your account.

Learn the term

Least privilege

Least privilege is the security rule of giving every person, tool or AI assistant only the access its job needs, and nothing more. If that access is misused or stolen, the damage stays small.

Learn the term

Website handover

A handover is the moment the site becomes fully yours: logins, domain, hosting, code, and the know-how to run it.

Learn the term

Want this done for you?

Built an app with AI and not sure about the database? Book a call and I'll show you what to check.

Twenty minutes and nothing to sign. The three changes are yours to keep either way.

Book a 20-minute call