We check whether one of your users can read another's data. Written authorisation first. Designed to minimise impact. You rest. We take the nightshift.
Can one of your users read another's data? We check multi-tenant apps using two labelled test accounts, only with your written authorisation. Free while we're new, plus one free re-check after your fix. Request a free scan via our profile.
UpGuard research: 16,326 Supabase databases had publicly readable tables, among ~300,000 domains showing signs of Supabase use. UpGuard attributes it mainly to project configuration, such as missing or overly broad RLS. Worth checking your RLS policies.
Quick Supabase RLS check: run select tablename, policyname from pg_policies where schemaname = 'public' and (qual = 'true' or with_check = 'true'); and review each hit. Fine for public data, risky for per-user rows. A clean result doesn't mean there are no issues.
For tenant checks in RLS, we read the tenant from app_metadata, not user_metadata. Signed-in users can change their own user_metadata from the client, so a policy that trusts it can let someone choose which tenant they belong to.
Postgres views run with their owner's rights by default, and in Supabase that owner is usually postgres, so a view can skip the RLS on the tables under it. On Postgres 15 and later, we create views with security_invoker = true so the caller's policies apply.
Adding RLS policies does not revoke table grants. On many projects, anon and authenticated still hold privileges until we revoke them and grant back only what the app needs.
Supabase Storage starts with no uploads allowed. Access is RLS on storage.objects. We scope each policy to a bucket and folder, and we keep any service key out of the browser.
A SECURITY DEFINER function runs as its owner and can bypass RLS. We keep those functions out of exposed schemas, set search_path to '', and schema-qualify every name so callers cannot redirect them.
We treat publishable and secret keys differently. The publishable key is safe in the client and only reaches what RLS allows. The secret key maps to service_role, bypasses RLS, and stays on servers we control.
@davishaal Agreed. A quick way to catch it: select * from pg_policies where qual = 'true' or with_check = 'true'. For views, check pg_class.reloptions for security_invoker=true on every view in public. Both take a minute to run.
@YasKTechTips@itsvlady Silent empty is normal when RLS blocks a row: zero matches, so supabase-js often returns error: null. Updates also need a SELECT policy on that table, because Postgres must read the row before changing it. Without SELECT, every update quietly does nothing.
@woodox4win For isolation testing: as user B, try select, update and delete on A's rows by id, then try setting your own user_id to A's. That last case needs with check. Also confirm RLS is actually on, not just a policy on a table with row security still off.
@Aakash_goell We'd put isolation in Postgres RLS, not only app filters. One missed route opens the table. Schema-per-tenant works but migrations hurt. Pattern: memberships, org_id in (select ... where user_id = (select auth.uid())), same in with check, two-account test after each migration.
@delali Good list. One addition: test writes as well as reads. Signed in as user B, try update and delete on A's rows, and try setting your own row's user_id to A's id. A select policy doesn't cover those; updates need both using and with check.
@RaviR_S@resend@supabase From day one we'd set up: RLS on every exposed table, one policy per operation using (select auth.uid()), with check on insert and update, indexes on user_id/org_id, private storage buckets with their own policies, and a two-account test after each migration.
Self-check for Supabase RLS: RLS on for every exposed table; no stray using (true); views with security_invoker; no user_metadata in policies; secret key server-side; test with two accounts that both own data. https://t.co/Dbk91ZUjO9
A Supabase table in an exposed schema without RLS is readable and writable by any role with a grant on it (Supabase docs). Also check using (true) policies and views without security_invoker. No error, no isolation. https://t.co/Dbk91ZUjO9