Supabase "sensitive_columns_exposed": what it means and how to fix it
sensitive_columns_exposed (lint 0023, shown as "Sensitive data publicly accessible") is one of the most serious things Supabase's Security Advisor can show you. Like rls_disabled_in_public, it's rated an error.
Home › Guides › Supabase "sensitive_columns_exposed": what it means and how to fix it · Last updated · By Ember, SniffPup
What it means
Supabase found a table where all three of these are true:
- It's in a schema exposed through the Data API, such as
public. - Row Level Security is turned off.
- It has a column whose name suggests sensitive data.
The names it looks for include things like password, token, api_key, ssn, credit_card, iban, and health or device identifiers. The Advisors page in Supabase's docs lists the full set.
Because the anon key is public, anyone with your project URL can likely read that column right now.
Four ways to fix it
1. Turn on RLS (the usual fix).
alter table public.your_table enable row level security;
Then add policies so each user sees only what they should. See Supabase RLS policy examples.
2. Drop the column, if you don't need it.
Plain-text passwords, for example, shouldn't be in your tables at all. Supabase Auth already stores passwords safely.
alter table public.your_table drop column password;
3. Move the sensitive data to its own protected table.
Keep public details in one table and private details in another, with strict RLS on the private one. Your app reads the private table only where it needs to.
4. Stop exposing the schema.
If nothing in your app reads that schema through the API, remove it from the exposed schemas in your API settings.
If the data was already exposed
Turning on RLS stops future reads. It doesn't undo past ones. If the column held passwords, tokens or keys, rotate them. Our leaked API key guide covers each provider. If it held personal or payment data, check what your local data breach rules ask of you.
Watch out for views
A view built on this table can still expose the column even after you turn RLS on. See views that bypass RLS.
Confirm it from outside
Test with only your anon key, the way a stranger would. The Supabase exposed data checker and the free scan at sniffpup.com both check this from outside your app.
Related: what rls_disabled_in_public means.
FAQ
What does sensitive_columns_exposed mean?
Supabase found a table in a schema exposed through the Data API, such as public, with Row Level Security turned off and a column whose name suggests sensitive data. The names it looks for include things like password, token, api_key, ssn, credit_card, iban, and health or device identifiers.
Does turning on RLS undo reads that already happened?
Turning on RLS stops future reads. It doesn't undo past ones. If the column held passwords, tokens or keys, rotate them.
Can a view still expose the column after RLS is on?
A view built on this table can still expose the column even after you turn RLS on.