afterbuild/ops
Symptom → fix

Users seeing each other's data? That's RLS misconfigured.

One user logs in and sees another user's records — invoices, messages, profiles. The symptom is a Supabase row-level security gap: RLS is off, or the policy is wrong. Here's how to confirm the cause and fix it.

Quick verdict

The diagnosis: if logged-in users can read rows that aren't theirs, RLS is either disabled on the table or the policy doesn't filter by auth.uid(). The fix: every table gets a policy, and every policy is tested with a script that logs in as a different user and confirms the row is not returned. No guessing. Missing RLS policies are among the most common gaps in the AI-built apps we audit.

Why users can see each other's data — the usual causes

01
RLS disabled by default
Lovable, Bolt, v0, and Windsurf all create Supabase projects with RLS disabled. They build fast; security is your problem.
02
Any authenticated user reads all rows
Without policies, `SELECT * FROM invoices` returns every invoice in the database regardless of who's logged in.
03
INSERT without ownership
Users can insert rows owned by other users. Common in AI-generated apps that skip the `auth.uid()` check.
04
UPDATE and DELETE without ownership check
A user can update or delete records that belong to another user. We've seen this in every production audit.
05
Service role key in the client bundle
AI tools sometimes use the service role key in frontend code, bypassing RLS entirely. We find and replace it.
06
Missing storage bucket policies
Supabase Storage buckets have their own RLS. AI-generated apps almost never set them.
07
Policies that look correct but aren't
A policy that selects `user_id = auth.uid()` but was written before the auth.uid() extension was enabled does nothing.

Ready to hand it off

Diagnosing the symptom is one thing; locking down every table, auth flow, and connection pool is another. Ready to hire? See the Supabase expert for AI-built apps — the full hire hub covering RLS, auth, server-side client, and query performance at fixed prices.

Related reading

Why users see each other's data in Supabase · Supabase data leak fix (48-hour playbook) · SaaS RLS blueprint with paste-ready SQL · Plain-English RLS guide

FAQ
Why can users see each other's data in my Supabase app?
Because row-level security isn't filtering the rows. RLS is the PostgreSQL feature that controls which rows a user can read, write, update, or delete. If it's disabled on the table — or the policy doesn't check auth.uid() — every authenticated user sees every row in your database. That's the exact symptom you're hitting.
How do I confirm it's an RLS problem and not something else?
Check the Supabase dashboard under Table Editor → [table] → RLS. If it says 'RLS disabled', that's your cause — every authenticated user can read every row. If RLS is on but users still see each other's data, the policy is wrong (often a USING (true) policy, or one written before auth.uid() was available). Log in as two different users and try to read the other's row; if it returns, RLS is misconfigured.
Can I just enable RLS and be done?
No — enabling RLS without writing policies locks everyone out. The policies define which rows each user is allowed to see. We write and test those policies.
How long does an RLS audit take?
48 hours for the written report. Fix work depends on the number of tables. Most apps with 8–15 tables take 2–3 days to fully secure.
What does the fix cost?
The initial audit is free. Fix work is included in our Security Audit package ($499) for apps up to 20 tables.
Will enabling RLS break my app?
Potentially yes if done wrong — that's why we do it carefully. We stage the change, test with real user tokens, and verify before going live.
Next step

Get a free RLS audit

Send us your project and we'll confirm exactly why users are seeing each other's data, identify every unprotected table, and send you a written report within 48 hours. No cost, no commitment.

Book free diagnostic →