The Database & Supabase specialist: can user A read user B’s data?
What ShipRely’s Database & Supabase specialist checks in your migrations: row level security, policies, grants, privileged functions, storage and tenant isolation.
- Read-only access to your repository
- Every finding with file and line
- Fix prompts for Lovable, Cursor, Claude Code and Bolt
The Database & Supabase specialist reads the SQL migrations, policies and database functions in your repository and answers one question: can one user or team reach another’s data? It reports tables without row level security, policies that let everyone in, columns the client should never set, SECURITY DEFINER functions anyone can call and storage rules that expose files, each with file, lines, severity, confidence and a fix prompt.
In a Supabase app the browser talks to your database directly, with a key that is public by design. That makes the database rules the real security boundary of your app. If a policy is missing or too generous, no amount of careful frontend code helps. The Database & Supabase specialist reads those rules the way a reviewer would.
What the specialist checks
It starts from the schema your repository defines, migration by migration, and asks for each table and function who can read, write or call it.
Row level security
Tables in the public schema without RLS, policies that let every row through, rules where signed-out visitors slip through a null branch, and rules based on a claim the user can edit.
Writes the client should not control
Insert or update policies that let users set the owner, a price, a paid status, credits or an admin flag on their own rows.
Privileged functions and views
SECURITY DEFINER functions without an auth check or fixed search_path, execute rights left open to everyone, and views that bypass RLS.
Storage, grants and tenants
Storage policies that let any caller list a bucket, grants to anon, and team or workspace data that another tenant can reach through a policy, an RPC or a join.
It also reviews PostgreSQL basics that turn into security or data problems: missing constraints, operations that should be atomic, dynamic SQL built from input and destructive migrations. It reads the code that calls the database too, so it can tell a policy that is wrong from one that is simply never used.
What it found in our test apps
Our benchmark apps are small Lovable-style projects with planted database mistakes and clean twins. In the run of 3 December 2026 the database findings below were reported by both specialists, Security and Database & Supabase, and merged into one finding each:
public.documents has no row level security and is granted to anon
supabase/migrations/20260119141500_documents.sql
projects SELECT/UPDATE policies only require sign-in, exposing all workspaces' projects
supabase/migrations/20260203102000_projects.sql
orders INSERT policy allows client-set payment_status, total_cents and user_id
supabase/migrations/20260305100000_orders.sql
add_credits RPC lets any signed-in user grant unlimited credits to any account
supabase/migrations/20260418160000_credit_purchases.sql
Just as important is what it did not report. One clean app contains things that look suspicious but are correct: an owner-only delete policy, a SECURITY DEFINER helper that only returns true or false, Realtime on a table with RLS and a scheduler function protected by a secret. The engine reported nothing there. A database reviewer that flags every SECURITY DEFINER function by reflex is noise; the methodology page explains how we test for that.
What a database finding looks like
Each finding names the object, cites the migration and the code that uses it, and explains the impact in plain language. The missing-RLS finding above cites line 12 of the migration, where the table is granted to anon, and lines 17–21 of src/hooks/useDocuments.ts, where the only owner filter runs in the browser. Then comes a fix that a tool can follow:
Add a new migration that enables row level security on public.documents, revokes all privileges from anon, and creates select, insert, update and delete policies for authenticated with auth.uid() = user_id (USING and WITH CHECK), mirroring the profiles policies. Do not edit the existing migration. Owners must still list, create and delete their own documents. Review existing rows after applying.
The fix is delivered as a new migration rather than an edit of an old one, because applied migrations don’t run again. It also points at a correct sibling, the profiles policies, to copy. The acceptance checks that come with it are written as “actor, action, expected result”, for example “a user cannot insert a document with another user’s user_id”, which is exactly what you test with two accounts afterwards.
Which depth to choose
- Quick (about 2–5 minutes): a fast pass over the most common, high-impact problems. Our benchmark runs use it. Good for a small app with one kind of user, or to re-check after a fix.
- Standard (about 5–15 minutes): broader coverage with every reported finding verified. The sensible default before a launch.
- Deep (about 15–40 minutes): exhaustive tracing across files and edge cases. Worth it for teams and workspaces, roles, and credits or payments stored in the database.
Which depths your plan includes is on the pricing page.
Read up first
If you’d like to understand the rules before you run an audit: row level security is explained in our Supabase RLS guide, how to test RLS policies with SQL shows how to check them as a real user, and SECURITY DEFINER functions done right covers privileged functions. The fixes for the findings above: table without RLS, policies with using (true), credits or paid status set by the client and SECURITY DEFINER without checks. For the application side, see the Security specialist.
Limits
The specialist describes what your repository defines, not the deployed database. A policy changed in the dashboard and never saved as a migration is invisible to it, and so are settings such as email confirmation or leaked-password protection. It doesn’t run SQL against your data. The report states what was examined and what wasn’t; it is not a certification.
Frequently asked questions
Does ShipRely connect to my Supabase database?
No. The specialist reads what your repository defines: SQL migrations, functions, policies, the Supabase config file and the code that calls the database. It never logs into Supabase or queries your data, so settings changed only in the dashboard are outside what it can see.
My Supabase Security Advisor is green. Do I still need this?
The Advisor is worth running and catches things like tables without RLS. A green Advisor doesn’t tell you whether a policy that exists is the right one: an insert policy that lets users set their own paid status, or a ‘members only’ rule that any signed-in user passes, is a logic question. That is what the specialist reads for.
Does it work without Supabase?
It reviews PostgreSQL schemas in general (migrations, constraints, privileges, functions and triggers), whether they come from Supabase, Prisma or Drizzle. The Supabase-specific checks, such as RLS policies with auth.uid(), storage policies and API keys, apply when the project uses Supabase or Lovable Cloud.
Which depth should I choose for a database audit?
Quick if you have a handful of tables and one kind of user. Standard before a launch. Deep if you have teams or workspaces, roles, or money in the database, because those problems sit in chains across policies, functions and triggers.
Sources
- 1.Row Level Security — Supabase Docs
- 2.Performance and Security Advisors — Supabase Docs
- 3.Row Security Policies — PostgreSQL Documentation
- 4.CWE-862: Missing Authorization — MITRE
Updated
Find this in your own app
ShipRely reads your repository (read-only), proves each finding with file and line, and gives you a fix prompt to paste into your AI builder.
Run a demo audit- Read-only access to your repository
- Every finding with file and line
- Fix prompts for Lovable, Cursor, Claude Code and Bolt