The auth.users table contains sensitive user data (emails, phone numbers, metadata, encrypted passwords). If this table is exposed in the API schema, any client can query it.
Detection
Splinter lint 0002 (auth_users_exposed) checks for this automatically.
SELECT EXISTS ( SELECT 1 FROM information_schema.role_table_grants WHERE table_schema = 'auth' AND table_name = 'users' AND grantee = 'anon' OR grantee = 'authenticated');
Fix
Revoke direct access and create a safe public profile view instead:
REVOKE ALL ON auth.users FROM anon, authenticated;-- Use a public.profile table insteadCREATE TABLE public.profile ( id uuid PRIMARY KEY REFERENCES auth.users(id), display_name text, avatar_url text);ALTER TABLE public.profile ENABLE ROW LEVEL SECURITY;