Supabase RLS is disabled. How do I fix it?
Short answer: enable Row Level Security on exposed tables, then add policies that match the real owner column and intended user roles. This guide explains what to verify and what the public scan cannot prove, without logging in, changing records, or treating an inconclusive response as a pass.
What the Supabase Row Level Security disabled check covers
When Row Level Security is disabled on an API-exposed table, grants and the database role determine whether a public client can read or change rows. The table may be reachable even if the app hides its screen.
The finding describes a public condition, not proof that someone has abused it. First preserve the relevant deployment details, then rotate exposed credentials or close the access path before investigating billing, logs, or affected records.
An anon or publishable key identifies the client, but it is not a user secret. The security boundary is the combination of grants, RLS policies, authenticated identity, and any server-only privileged operation.
Understand the evidence before changing code
Start with the exact schema and table reported. List its intended readers and writers, identify the owner column, and check whether another policy or broad grant already exposes data before applying a migration.
Severity reflects potential impact and reach, not certainty of exploitation. A public key can be intentionally visible; the important distinction is what the provider allows that key to do and which server-side policy still applies.
Apply the narrow, safe change
Enable RLS and add a policy for each required operation. For a user-owned table, compare the authenticated subject with the row's owner field; avoid a universal USING or WITH CHECK condition.
alter table public.records enable row level security;
create policy "owner reads records" on public.records
for select to authenticated
using ((select auth.uid()) = user_id);Prefer the smallest repair that restores the intended boundary. Keep public client configuration public, move privileged operations behind an authenticated server route, and make data rules depend on the authenticated owner or an explicit role.
Verify the production result
Apply the migration in a reviewable environment, then test as anonymous, as the owner, and as a different signed-in user. A correct result denies the last two unauthorized cases without breaking intended access.
Use the snippet as a starting point, not a blind migration. Confirm the real table, environment, route, identity claim, and deployment platform first; a copied policy with the wrong owner field can block legitimate users or expose the wrong records.
Keep the issue from returning
Keep policy SQL in version control and add Supabase database tests for each role. Review new tables created by an agent or migration because enabling RLS on one table does not protect another.
Verify the repair from the same public vantage point that exposed it. Check the deployed response, confirm the finding is gone, and test the intended signed-in user and an unrelated user through the normal application flow.
Limits and next steps
The scan cannot inspect every SQL grant or prove all authenticated policies are correct. Review the deployed policies and test the real application queries, including inserts and updates.
Prevent recurrence with a reviewed migration, a secret scanner, and a small regression test that runs before deploy. Store only the minimum required credential, scope it to one project, and define who can rotate it.
A public scanner cannot establish whether private records were accessed or whether an account was compromised. If a real secret shipped, revoke it with the provider and review the provider's usage and audit history.
Key facts
- RLS is configured per table, not automatically inherited by every new table.
- A public anon key does not bypass a correctly enforced RLS policy.
- The owner column and authenticated claim must match the application's data model.
Questions
Can a clean Supabase Row Level Security disabled check prove the app is secure?
What should I do first if the finding is real?
Does ProofForge change application data?
What should I do after the repair?
Official documentation referenced
Related
Last updated 2026-11-25 · Reviewed by ProofForge · Methodology · Markdown