Commit 9427a4e
committed
fix: prevent non-superuser roles from dropping supabase_privileged_role
Add supabase_privileged_role to supautils.reserved_roles so non-superusers
with CREATEROLE cannot drop it on PG 15, where PG's native ADMIN OPTION
check (introduced in PG 16) does not apply.
PG 16+ requires ADMIN OPTION to drop a non-superuser role:
https://github.com/postgres/postgres/blame/REL_16_STABLE/src/backend/commands/user.c#L1175
This check is absent in PG 15:
https://github.com/postgres/postgres/blob/REL_15_STABLE/src/backend/commands/user.c#L986
Fixes: https://linear.app/supabase/issue/PSQL-12051 parent 438c36b commit 9427a4e
1 file changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
0 commit comments