# Supabase Security Advisor: Every Warning and What to Fix First

URL: https://tuvio.dev/blog/supabase-security-advisor
Published: 2026-11-18
By the Tuvio team

The Supabase Security Advisor is a set of automatic checks on your project's database and auth settings. It lists each problem it finds at one of three levels: ERROR, WARN or INFO. The errors are mostly ways your data can be read or changed by people who shouldn't reach it, so fix those first. The warnings are hardening. The info items are often fine as they are.

This guide goes through the warnings you're most likely to see, in plain words, with the fix or a link to the full walkthrough for each, and then the things the Advisor has no way to check.

## What the Supabase Security Advisor is

Supabase's [Advisors docs](https://supabase.com/docs/guides/database/database-advisors) describe them this way: "Advisors are deterministic checks that ship with the platform. They flag health, security, and performance issues in your project, such as elevated error rates, misconfigured RLS policies, or missing indexes."

"Deterministic" is the useful word. Each check is a fixed query against your database, not an AI opinion, so the same database gives the same result every time. The database checks are open source, in Supabase's [splinter](https://github.com/supabase/splinter) repository, where you can read exactly what each one looks for. The lint names, levels and quoted descriptions in this post come from there and from the docs, as of November 2026.

You can run it from three places, per the same docs page:

- **The dashboard:** open **Advisors**, then **Security Advisor**.
- **The CLI:** `supabase db advisors`.
- **An AI coding tool** connected to Supabase's MCP server, through its `get_advisors` tool with the type set to `security`. This is how a tool such as Cursor or Claude Code can read the same findings.

The docs add a caution worth keeping in mind before you change anything: "Some findings may be intentional, so check them against your intended schema and access model before you change anything."

## Security Advisor levels: ERROR, WARN and INFO

- **ERROR:** something is exposed or will break. Most of these mean data is reachable through your API without the protection you assumed.
- **WARN:** a weaker setting or a risky shape. Not an open door by itself, but worth closing.
- **INFO:** a fact to confirm. Often correct as it is.

Fix in that order. A project with one ERROR and twenty WARNs has one job to do today.

## Supabase Security Advisor errors: fix these first

| Lint | What it means | Fix |
|---|---|---|
| RLS Disabled in Public | A table the API can reach has no row level security, so anyone with your project URL and public key can read and change it | `alter table ... enable row level security`, then add policies |
| Policy Exists RLS Disabled | You wrote policies, but RLS was never turned on for the table, so they do nothing | Enable RLS on the table |
| RLS references user metadata | A policy trusts `user_metadata`, which a user can edit on their own account | Use `app_metadata` or a table only your server writes |
| Security Definer View | A view runs with its creator's rights and skips the RLS of whoever queries it | `alter view ... set (security_invoker = on)` |
| Exposed Auth Users | A view in an API schema exposes `auth.users` | Drop the view and keep a `public.profiles` table with RLS instead |
| Sensitive Columns Exposed | A table without RLS has columns that look like passwords, tokens or personal data | Enable RLS and add policies |

### RLS Disabled in Public

This is the one that causes real leaks. The lint's own docs say: "Anyone with your project URL can read, edit, and delete all data in this table because Row-Level Security is not enabled." The dashboard may show it as "Table publicly accessible".

The fix is two parts: turn RLS on, then add policies so your app still works. Turning it on without policies makes the table return nothing, which is the next confusing bug. The full walkthrough is in [Supabase RLS disabled in public](https://tuvio.dev/blog/supabase-rls-disabled-in-public), and the policies to copy are in [Supabase RLS policy examples](https://tuvio.dev/blog/supabase-rls-policy-examples).

### Policy Exists RLS Disabled

You or your AI tool wrote a correct policy and it isn't being applied, because Postgres only uses policies on tables where RLS is enabled. One line fixes it:

```sql
alter table public.invoices enable row level security;
```

The lint definition marks this ERROR. Its page in the lint docs shows INFO at the time of writing. Treat it as an error: the table is as open as one with no policy at all.

### RLS references user metadata

A policy like this looks reasonable and isn't:

```sql
-- A user can set this value on their own account
using ((auth.jwt() -> 'user_metadata' ->> 'role') = 'admin')
```

The lint's docs put it plainly: the policy "references user_metadata, which end users can freely modify, allowing them to bypass access controls." Any signed-in user can call `supabase.auth.updateUser({ data: { role: 'admin' } })`. Keep roles in `app_metadata`, which only your server can write, or in a table users can't update.

### Security Definer View

By default a Postgres view runs with the rights of whoever created it. On Supabase that's usually a role that bypasses RLS, so a view over a protected table can hand out every row. On Postgres 15 and later:

```sql
alter view public.order_summaries set (security_invoker = on);
```

After that the view applies the RLS of the person querying it. Check that the app still shows what it should, because rows the view used to leak will now be filtered.

## Supabase Security Advisor warnings

| Lint | What it means | Fix |
|---|---|---|
| Function Search Path Mutable | A function doesn't fix its `search_path`, so the tables it reads can depend on the caller | `set search_path = ''` and schema-qualify names |
| RLS Policy Always True | An insert, update or delete policy with `using (true)` or `with check (true)` | Limit the policy to the row's owner |
| Public Can Execute SECURITY DEFINER Function | A function that bypasses RLS can be called by anyone with your public key | Revoke `execute`, or make it `security invoker` |
| Signed-In Users Can Execute SECURITY DEFINER Function | The same, for any signed-in user | Same, for `authenticated` |
| Leaked Password Protection Disabled | Supabase Auth accepts passwords that are in public breach lists | Turn on the setting (Pro plan and above) |
| Materialized View in API | A materialized view is reachable through the API, and RLS can't protect one | Revoke `select` on it from `anon` and `authenticated` |
| Public Bucket Allows Listing | A public storage bucket has a broad read policy, so clients can list every file | Remove the `select` policy on `storage.objects` (public file URLs keep working) |
| Extension in Public | An extension is installed in the `public` schema | `alter extension ... set schema extensions` |

### Function Search Path Mutable

The most common warning, because it fires for every function without the setting. It matters most on `security definer` functions. The quick fix that clears the warning can leave the function broken or still unsafe, so this one has its own post: [function search path mutable](https://tuvio.dev/blog/supabase-function-search-path-mutable), with a query that lists every affected function.

### RLS Policy Always True

RLS is on, and a policy lets everyone through anyway. The lint's docs say such a policy "defeats the purpose of having Row-Level Security enabled."

One detail that surprises people: this lint skips `select` policies. Its description says "SELECT policies with `USING (true)` are intentionally excluded as this pattern is often used deliberately for public read access." So a table of user emails with a `for select using (true)` policy gets no warning here. The Advisor can't know whether a table is meant to be public. You have to check read policies yourself, and [how to test Supabase RLS](https://tuvio.dev/blog/how-to-test-supabase-rls) shows how to do it as two different users.

### SECURITY DEFINER functions anyone can execute

A function in `public` can be called through the API at `/rest/v1/rpc/<name>` by any role with `execute` on it, and new functions get that by default. If the function is `security definer`, it runs with its owner's rights and reads past RLS. The lint docs describe the result as "a public exfiltration endpoint" when a helper meant for an admin script is left callable.

For each finding, pick one:

```sql
-- Nobody outside your server should call it
revoke execute on function public.delete_account(uuid) from public, anon, authenticated;

-- Or: it doesn't need to bypass RLS
alter function public.delete_account(uuid) security invoker;
```

If a role must call it, keep that role's grant and make sure the function checks who is calling, with `auth.uid()`, before it reads or writes anything. Some are public on purpose, such as a contact-form insert. Those findings can stay.

### Leaked Password Protection Disabled

An Auth setting, not a database problem. No SQL fixes it, and it needs the Pro plan. The steps, and what to do on the Free plan, are in [leaked password protection is currently disabled](https://tuvio.dev/blog/supabase-leaked-password-protection).

## Info: RLS Enabled No Policy

"RLS Enabled No Policy" means a table has RLS on and no policies, so nobody can read or write it through the API. The lint's docs describe it as "no data can be read or written through the API."

That is the right state for a table only your server uses with the secret key, such as webhook events. It's a bug only if your app is supposed to read the table from the browser and gets empty results. Then add a policy.

## The order to fix Security Advisor findings

1. **RLS Disabled in Public** and **Policy Exists RLS Disabled.** Open tables first.
2. **Sensitive Columns Exposed** and **Exposed Auth Users.** Usually fixed by step 1 or by dropping a view.
3. **RLS references user metadata.** A policy any user can talk their way past.
4. **Security Definer View.**
5. **SECURITY DEFINER functions anyone can execute.**
6. **RLS Policy Always True.**
7. **Function Search Path Mutable**, starting with `security definer` functions.
8. **Leaked Password Protection**, storage listing and the rest.

After each step, open the Advisor again, and use the app as a normal user to check nothing broke. If a table starts returning `permission denied for table` after a change, that's a missing grant, covered in [Supabase permission denied for table](https://tuvio.dev/blog/supabase-permission-denied-for-table).

## What the Supabase Security Advisor can't see

The Advisor checks the database and auth settings of one project, as they are right now. That leaves real gaps.

- **Whether a policy is right.** It can spot `using (true)` on writes. It can't tell that your `orders` policy compares the wrong column, or that any signed-in user can read every row because a read policy is broader than you meant.
- **Your application code.** A secret key shipped to the browser, an API route that never checks who is logged in, a Stripe webhook that trusts any request: none of that is in the database.
- **Your repository.** Keys committed to git, vulnerable packages, and migration files that haven't been applied yet. A migration that turns RLS off will pass the Advisor today and fail it after the next deploy.
- **Other environments.** A clean result on production says nothing about the staging project or the one a teammate's branch creates.

So a clean Security Advisor means "none of these known database shapes are present", not "the app is secure". It is still the first thing to run on a Supabase project.

## Checking the code side

Tuvio covers part of what the Advisor can't see, from the other direction. A free [scan](https://tuvio.dev/scan) needs no account and reads your GitHub repository. In the Supabase migrations it flags tables that are created and never get RLS, policies open to anyone or to any logged-in user, policies that trust `user_metadata`, views that skip RLS, and `security definer` functions without a `search_path` or without a check on the caller. In the rest of the repo it flags leaked keys, including ones in git history, and packages with known vulnerabilities.

It has the opposite blind spot: it reads files, so a table or setting you changed only in the dashboard isn't seen, and it doesn't check Auth settings such as leaked password protection. Use both. The full list of what Tuvio checks is on the [coverage page](https://tuvio.dev/coverage), and the wider pre-launch list is in the [vibe coding security checklist](https://tuvio.dev/blog/vibe-coding-security-checklist).

## Security Advisor checklist

1. Open **Advisors**, then **Security Advisor**, or run `supabase db advisors`.
2. Fix every ERROR, open tables first.
3. For each `security definer` function, decide who may call it and fix its search path.
4. Read your `select` policies by hand. The Advisor skips `using (true)` on reads.
5. Decide which INFO items are intentional and leave them.
6. Save every fix as a migration, so the next environment gets it too.
7. Run the Advisor again after each deploy that changes the schema.
