Audit Supabase RLS Write Policies to Prevent Unauthorized ChangesAudit Supabase RLS Write Policies to Prevent Unauthorized Changes
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
Your read rules are locked down. Can users still edit each other's data?
A lot of Lovable, Bolt and Replit apps on Supabase get reading right: user A can't see user B's rows. Writes get checked much less often.
In Supabase, each access rule (RLS policy) covers one action: read, add, change or delete. A strict read rule doesn't protect changes or deletes. If your update or delete rule doesn't check who owns the row, any signed-in user may be able to change or delete everyone's rows.
A quick check with two test accounts and fake data:
1. As user B, create something (a post, a profile edit, an order).
2. Sign in as user A and try to edit or delete it.
3. Sign back in as user B and look. If the change stuck or the row is gone, the write rules need fixing. (A blocked change often shows no error, it just changes nothing, so check the data.)
In the Supabase dashboard, look at each table's UPDATE, DELETE and ALL policies. Watch for a rule that just says true, a rule that never mentions auth.uid(), or one that trusts something users control: a column they can set themselves, like role or is_admin, or a user_id sent from the app.
The fix is to keep RLS on and make every write check that the signed-in user owns the row, then remove the old loose policies. Policies add up, so an old "allow everyone" rule can still let people in alongside your new strict one.
If the test turns something up and you'd rather have it fixed, our Security Fix ($149) here on Contra covers RLS on your tables (up to 25), storage policies and a key scan.
PatchAndShip is not affiliated with Supabase.

patchandship.com

Can other users change or delete my users’ data? How to check and lock it down

Can one user edit or delete another user’s data in your Supabase app? Here’s how to check, and how to lock every change to the row’s owner with RLS.

Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started