fix: revoke CREATEROLE from supabase_auth_admin - #2386
Open
jaysomani wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug fix (security hardening — privilege scoping)
What is the current behavior?
supabase_auth_adminis created withCREATEROLEprivilege in the base init script and no subsequent migration ever revokes it.Fixes #1518
What is the new behavior?
supabase_auth_adminis created withNOCREATEROLEon fresh installs. A new migration revokes the privilege on existing installs.The auth service (GoTrue) never issues any
CREATE ROLEstatements 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_adminonly as a first, auditable step.supabase_functions_admin,supabase_storage_admin, anddashboard_userhave the same pattern — happy to follow up with a separate PR for those once this lands.-- migrate:downleft 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.