Skip to content

fix: revoke CREATEROLE from supabase_auth_admin - #2386

Open
jaysomani wants to merge 1 commit into
supabase:developfrom
jaysomani:fix/revoke-auth-admin-createrole
Open

fix: revoke CREATEROLE from supabase_auth_admin#2386
jaysomani wants to merge 1 commit into
supabase:developfrom
jaysomani:fix/revoke-auth-admin-createrole

Conversation

@jaysomani

Copy link
Copy Markdown

What kind of change does this PR introduce?

Bug fix (security hardening — privilege scoping)

What is the current behavior?

supabase_auth_admin is created with CREATEROLE privilege in the base init script and no subsequent migration ever revokes it.

Fixes #1518

What is the new behavior?

supabase_auth_admin is created with NOCREATEROLE on fresh installs. A new migration revokes the privilege on existing installs.

The auth service (GoTrue) never issues any CREATE ROLE statements at runtime — confirmed by grepping the entire supabase/auth source (grep -rn "CREATE ROLE|CREATEROLE" --include="*.go" excluding tests and vendor) — zero hits. The privilege appears vestigial.

Golden files updated accordingly (roles.out, z_multigres-orioledb-17_roles.out).

Additional context

Scoped to supabase_auth_admin only as a first, auditable step. supabase_functions_admin, supabase_storage_admin, and dashboard_user have the same pattern — happy to follow up with a separate PR for those once this lands.

-- migrate:down left empty, matching the convention of recent privilege-only migrations (20250205060043, 20250421084701). Did not run the full Nix regression suite locally — would want CI to confirm before merge.

@jaysomani
jaysomani requested review from a team as code owners August 21, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

supabase_auth_admin can CREATE roles

1 participant