Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions supabase/migrations/20260729000000_add_profiles_rls_policy.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- Fix overly-permissive profiles table RLS policy (#1870)
-- Restrict profile reads to only the authenticated user's own profile
-- Prevents unauthorized email and profile metadata exposure via anon key

-- Drop the overly-permissive public read policy
DROP POLICY IF EXISTS "Public profiles are viewable by everyone." ON public.profiles;

-- Replace with secure policy: Users can only read their own profile
CREATE POLICY "profiles_select_own"
ON public.profiles
FOR SELECT
USING (auth.uid() = id);

Loading