Skip to content

Supabase security questionI turned on RLS in Supabase. Is my data safe now?

A scanner or a warning told you to enable row-level security, and you did. That’s the right first step, but Supabase’s own guide names several ways data still gets out with RLS on. Here’s what to check, or hand it over at a fixed price.

Short answer

Not necessarily. Turning on RLS is the first step, not the last. Check four things: that signed-out visitors don’t have permissions on tables they don’t need, that any view over a protected table follows the table’s rules, that no rule lets everyone read private data, and that the admin key (secret or service_role) never reaches the browser. Then test the rules by signing in as two different users.

What to check once RLS is on

  1. 01

    Grants the anon role still has

    “Adding policies doesn't take those grants back.” Supabase, Row Level Security

    Policies decide which rows a role sees; table grants decide what it can do at all. A grant left in place can give signed-out visitors a way to insert rows that a policy alone doesn’t close. Revoke what the anon role doesn’t need.

  2. 02

    Views that skip RLS

    “A view over a protected table hands out every row its policies were meant to withhold” Supabase, Row Level Security

    Views skip RLS by default, because they usually run as the postgres user that created them. A view over a protected table can return every row the table’s policies hold back. On Postgres 15 or later, Supabase’s guide shows how to make a view follow the policies of its tables. On older versions, revoke the anon and authenticated roles’ access to the view, or keep it in a schema the API doesn’t expose.

  3. 03

    Policies that let everyone in

    “Use it only for data that is meant to be public.” Supabase, Row Level Security

    A select policy written as using (true) for the anon role gives every signed-out visitor read access to every row their grants already reach. That suits published content, and nothing personal.

  4. 04

    A key that skips RLS entirely

    “Never use a secret key in the browser or expose it to customers.” Supabase, Row Level Security

    The secret or service_role key skips RLS by design, which is why Supabase says to keep it out of the browser. If it has been in front-end code, anyone who found it can get past the policies above, so replace it.

  5. 05

    Policies nobody has tested

    Supabase’s guide suggests a SQL test file per table under supabase/tests, run with supabase test db, that checks what each role can and can’t do. At the very least, sign in as two users and confirm neither can read or change the other’s rows.

Checked against the vendor’s docs on : Supabase docs: Row Level Security.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

Related: Free Supabase RLS policy checker · Free Supabase grants checker · Supabase service_role key exposed · Supabase anon key in frontend code · Supabase RLS fixes

Questions

More on this error

The RLS checker passed. Am I done?

The checker reads your policies and flags risky patterns. Grants, views and keys shipped to the browser still need checking, and the free AI app check looks for keys in your site’s JavaScript.

Why do I get error 42501 after revoking grants?

Supabase’s guide says a missing grant raises 42501 before any policy runs, so the role needs a grant for what it should be allowed to do. The same code also appears when a policy rejects a new row, which has its own page below.

Can you lock it down for me?

The project stays in your Supabase account. We write the grant changes, view fixes, policies and a policy test file as a migration in a pull request you review and apply.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; we reply by email, usually within one business day.