Supabase database
Supabase Security Advisor warnings explained: which ones mean your data is exposed?
Fix “RLS Disabled in Public”, “Sensitive Columns Exposed”, “Policy Exists RLS Disabled”, “Security Definer View” and “Public Can Execute SECURITY DEFINER Function” first: in our lab each one let a logged-out visitor read or change data. “RLS Enabled No Policy” is the opposite, a locked table, and “Function Search Path Mutable” is hardening; one leak, a public read policy of using (true), gets no warning at all.
TL;DR
- We built a database with each condition, ran Supabase’s own linter (splinter, the code behind the Security Advisor) and then called the API with only the public key.
- Six warnings matched a real read or write by a logged-out visitor.
- A
select … using (true)policy on a table of emails and phone numbers was read in full, and the linter said nothing: its “always true” check skips SELECT on purpose. - A clean Security Advisor is a good start, not proof. Test as a visitor and as a second user.
Where the warnings come from
The Security Advisor in the Supabase dashboard runs a set of SQL checks called lints. They are open source as supabase/splinter. Each has a number, a title and a level: ERROR, WARN or INFO. We ran the security lints from splinter’s main branch (commit cc529aa, 17 Nov 2026) on a lab database, so the titles below are the exact text you see.
The warnings, and what a stranger could do in our lab
| Warning (lint, level) | What it means | Lab: logged-out visitor with the public key | Fix |
|---|---|---|---|
| RLS Disabled in Public (0013, ERROR) | A table the API exposes has row level security off | Read every row, including a password column, and deleted every row | alter table … enable row level security; then add policies |
| Sensitive Columns Exposed (0023, ERROR) | As above, and a column name looks sensitive (password, token, passport…) | Same table: {"email":"carol@…","password":"hunter2"} | Enable RLS; move secrets out of exposed tables |
| Policy Exists RLS Disabled (0007, ERROR in the linter code) | You wrote policies but never turned RLS on, so they do nothing | Read the invoice the policy was meant to protect | Enable RLS on that table |
| Security Definer View (0010, ERROR) | A view runs as its owner and skips the policies on the tables under it | Read both users’ orders and addresses through the view, though the table was owner-only | alter view … set (security_invoker = true); (guide) |
| Public Can Execute SECURITY DEFINER Function (0028, WARN) | Anyone can call a function that runs with its owner’s rights | Called /rpc/get_email with another user’s id and got their email | Revoke execute, or move it out of public (guide) |
| Signed-In Users Can Execute SECURITY DEFINER Function (0029, WARN) | The same, for any signed-up user | Not called as a signed-in user here. Supabase’s docs say revoking from anon alone leaves it callable by every signed-up user | Revoke from anon and authenticated |
| RLS Policy Always True (0024, WARN) | An INSERT, UPDATE or DELETE policy is true | Rewrote another user’s comment | Owner condition (is using (true) safe?) |
| RLS references user metadata (0015, ERROR) | A policy trusts user_metadata, which users can edit themselves | Not tested over the API here; Supabase’s docs show the one-line bypass | Use app_metadata or a roles table (guide) |
| Function Search Path Mutable (0011, WARN) | A function doesn’t pin its search path | Nothing through the API | set search_path = '' and qualified names (guide) |
| RLS Enabled No Policy (0008, INFO) | RLS is on and nothing is allowed | []: locked, not leaking | Add a policy only if the app needs the table (empty array guide) |
| No warning | A SELECT policy of using (true) | Read every email and phone number | Owner condition, or split public and private columns (guide) |
Supabase’s docs page lists 0007 as INFO, but the linter code we ran reports it as ERROR. Either way, treat it as urgent: in our lab the policy protected nothing.
Lab output
Policy Exists RLS Disabled | ERROR | Table `public.invoices` has RLS policies but RLS is not enabled on the table.
RLS Disabled in Public | ERROR | Table `public.customers` is public, but RLS has not been enabled.
RLS Disabled in Public | ERROR | Table `public.invoices` is public, but RLS has not been enabled.
RLS references user metadata | ERROR | Table `public.reports` has a row level security policy `admins` that references Supabase Auth `user_metadata`.
Security Definer View | ERROR | View `public.order_summary` is defined with the SECURITY DEFINER property
Sensitive Columns Exposed | ERROR | Table `public.customers` is exposed via API without RLS and contains potentially sensitive column(s): password.
Function Search Path Mutable | WARN | Function `public.get_email` has a role mutable search_path
Public Can Execute SECURITY DEFINER Function | WARN | Function `public.get_email(uid uuid)` can be executed by the `anon` role …
RLS Policy Always True | WARN | Table `public.comments` has an RLS policy `Enable update for all users` for `UPDATE` …
Signed-In Users Can Execute SECURITY DEFINER Function | WARN | Function `public.get_email(uid uuid)` can be executed by the `authenticated` role …
RLS Enabled No Policy | INFO | Table `public.audit_log` has RLS enabled, but no policies exist0013 customers: anon GET: [{"email":"carol@example.com","password":"hunter2"}] [HTTP 200]
0013 customers: anon DELETE: [HTTP 204]
0007 invoices: anon GET: [{"amount":1200}] [HTTP 200]
0008 audit_log: anon GET: [] [HTTP 200]
0010 order_summary view: [{"id":1,"item":"desk","address":"1 High St"},{"id":2,"item":"lamp","address":"2 Low Rd"}] [HTTP 200]
0024 comments: anon PATCH: [{"id":1,…,"body":"defaced"}] [HTTP 200]
(not flagged) members, select using (true): [{"email":"dan@example.com","phone":"07700 900456"}] [HTTP 200]
0028 get_email: anon rpc with alice's id: "alice@example.com" [HTTP 200]The leak the Advisor doesn’t flag
Supabase’s docs page for 0024 shows a SELECT example, but the linter’s code says SELECT policies with using (true) “are intentionally excluded”, because public read access is often deliberate. That’s fair for a product list. It is also exactly how a profiles or bookings table ends up readable by anyone, as in our members table. This read-only query lists every always-true policy, reads included:
select tablename, policyname, cmd, roles, qual as using_expr, with_check
from pg_policies
where schemaname = 'public' and (qual = 'true' or with_check = 'true')
order by tablename, cmd;For each SELECT row, ask whether a stranger should see every row of that table. If not, see is using (true) safe?
What to fix first
- Every ERROR in the table above, plus 0028 and 0029. They are reachable with the key in your site’s JavaScript.
- Always-true SELECT policies on tables with personal data (the query above).
- 0024 write policies.
- 0011, then the rest.
After each fix, test as a logged-out visitor and as a second signed-in user, not in the SQL editor, which skips RLS. The two-account test shows how.
Ask your AI builder to fix it
Here is my Supabase Security Advisor output: [paste it]. Fix the ERROR items and any "SECURITY DEFINER Function" warnings one at a time, as separate migrations. Never fix a warning by disabling RLS or by adding a policy with using (true). For tables with RLS off, enable it and add owner-only policies (auth.uid() = user_id). For views, set security_invoker = true. For SECURITY DEFINER functions, revoke execute from anon and authenticated unless the app calls them, and set search_path = ''. Also list any SELECT policy using (true) on a table with personal data. Show me each migration before you apply it.Questions people ask
Which Supabase Security Advisor warnings are the most serious?
The ERROR ones that touch exposed tables: RLS Disabled in Public, Sensitive Columns Exposed, Policy Exists RLS Disabled and Security Definer View, plus Public Can Execute SECURITY DEFINER Function. In our lab each let a logged-out visitor read or change data with only the public key.
Is "RLS Enabled No Policy" a security problem?
No. It is level INFO and means nobody can read or write the table through the API. In our lab a visitor got an empty list. Add a policy only if the app needs the table.
If the Security Advisor shows no errors, is my Supabase app secure?
Not necessarily. The always-true check skips SELECT policies on purpose, so a public read policy on a table of emails gets no warning, and no lint can tell whether one signed-in user can read another's rows. Test as a visitor and as a second user.
What does "Security Definer View" mean in Supabase?
A view in an exposed schema runs with its creator's rights, so it ignores the row level security on the tables it reads. In our lab a logged-out visitor read every order through the view. Set security_invoker = true on the view.
Sources and lab
- Supabase: Advisors (every lint with level, rationale and fix), read 5 Dec 2026.
- supabase/splinter lints at commit cc529aa (17 Nov 2026): titles, levels, and the 0024 note excluding SELECT.
- Supabase: Row Level Security, read 5 Dec 2026.
- Lab: Postgres 17.11 and 18.6 with PostgREST 12.2.12 and a Supabase role shim; splinter’s security lints installed as views and queried; then real HTTP requests with only the public key, 5 Dec 2026. Synthetic data only. Same results on both versions.
Related findings
The checks behind this guide, each with example code, a self-check and the fix.
Row level security not enabled
PL-005Always-true policy
PL-014 · comingView skips row level security
PL-006SECURITY DEFINER function exposed
PL-019Access decided by user_metadata, which users can edit
PL-001Anonymous visitor can read personal data
Free check
Check your migrations for this, free.
Paste a public GitHub repo. The free RLS check reads its supabase/migrations and flags tables with RLS off or no policies, always-true policies, update policies with no WITH CHECK, SECURITY DEFINER functions anyone can call or with no fixed search_path, views that skip RLS and public buckets. It never connects to your database.
Written by Manraj Singh Dhillon. Last checked 5 Dec 2026. Code samples are synthetic and run against your own project; nothing here names a real app. Spotted a mistake? Tell us.