What does USING (true) mean in a Supabase policy?
Short answer: replace an unrestricted policy with a role-specific condition that checks the authenticated user against the actual row owner. 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 RLS policy using true check covers
A permissive policy with USING (true) allows every matching database role to see every row for the policy's command. If that role includes anon, the table can be readable without an account.
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.
Policies combine with PostgreSQL's command and role rules, so inspect every policy on the table rather than editing one line in isolation. A restrictive policy does not erase an overly broad permissive policy.
Understand the evidence before changing code
Before changing SQL, identify which rows should belong to each user and which operations are needed. Confirm the table's real owner field and whether the client is authenticated when the request runs.
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
Replace the universal predicate with a condition tied to the authenticated identity, such as auth.uid() matching the row owner. Write separate select, insert, update, and delete policies when their rules differ.
drop policy if exists "public read" on public.records;
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
Test with a table containing two users' records. Anonymous access should be denied, the owner should see only their own record, and a different signed-in account should not read or modify it.
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
Add a database test that fails if a policy becomes universally true. Review any migration generated by an AI agent and search the schema for other broad predicates before release.
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
A policy expression alone does not describe all effective access; grants, roles, security-definer functions, and other policies also matter. Verify the full deployed policy set.
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
- Permissive PostgreSQL policies can combine with OR semantics.
- A USING predicate controls visible existing rows for its command.
- A separate WITH CHECK condition is needed to validate inserted or updated rows.
Questions
Can a clean Supabase RLS policy using true 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