SIGSEGV on function EXECUTE permission denial when a superuser session has SET ROLE (17.6.1.106; clean on 17.6.1.071)
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- docker, postgresql
- Ambito
- databases
Direzione di ricerca
Inizia riproducendo il caso SQL con le immagini 17.6.1.106 e 17.6.1.071, quindi confronta le modifiche alla build delle immagini tra queste versioni. Il file sorgente rilevante o il test che fallisce non è stato identificato; il lavoro è completato quando il rifiuto dell'autorizzazione restituisce 42501 senza un SIGSEGV, mentre l'immagine interessata rimane utilizzabile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
On supabase/postgres:17.6.1.106 a function EXECUTE permission denial raises SIGSEGV and takes down the whole postmaster (all server processes terminated; reinitializing), instead of returning 42501 permission denied for function.
supabase/postgres:17.6.1.071 returns the error cleanly. Both images report server_version = 17.6, so this is an image-build regression rather than a Postgres version difference.
This breaks any pgTAP suite that asserts a function is not executable by a given role, because supabase test db connects as the superuser postgres.
Reproduction
Against a stock supabase start on an affected image:
CREATE FUNCTION public.zz_t() RETURNS boolean LANGUAGE sql STABLE SECURITY DEFINER AS 'SELECT true';
REVOKE ALL ON FUNCTION public.zz_t() FROM PUBLIC, anon;
BEGIN; SET LOCAL ROLE anon; SELECT public.zz_t(); COMMIT;
Result:
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
Postmaster log:
LOG: server process (PID 370) was terminated by signal 11: Segmentation fault
LOG: all server processes terminated; reinitializing
LOG: database system was not properly shut down; automatic recovery in progress
Conditions required
All three must hold. Removing any one gives a clean ERROR: permission denied for function:
- The login role is a superuser (
postgres). A non-superuser login is unaffected — connecting asauthenticatorand doingSET ROLE anonreturns the error cleanly, which is why PostgREST traffic does not trigger it. - The role has been switched via
SET ROLEorSET LOCAL ROLE. - The denial is on a FUNCTION. A table permission denial (
permission denied for table) under identical conditions is clean.
Also reproduces with SET ROLE (not just SET LOCAL ROLE), and with authenticated as well as anon, so it is not role-specific. Still crashes with SET pgaudit.log = 'none', so it does not appear to be pgaudit's logging path.
Affected / unaffected
| Image | server_version |
Result |
|---|---|---|
public.ecr.aws/supabase/postgres:17.6.1.071 (Supabase CLI 2.72.7) |
17.6 | clean ERROR: permission denied for function |
public.ecr.aws/supabase/postgres:17.6.1.106 (Supabase CLI 2.98.2) |
17.6 | SIGSEGV |
shared_preload_libraries on the affected image: pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, auto_explain, pg_tle, plan_filter, supabase_vault
Impact
Production traffic through PostgREST is unaffected (it logs in as the non-superuser authenticator) — verified with live anon-key HTTP calls, which return 401 42501 with the server staying up. The practical impact is on local/CI testing: any pgTAP assertion that a role cannot execute a function crashes the database, since supabase test db connects as postgres.
- Lingua principale
- Nix
- Stelle
- 1.8k
- Fork
- 268
- Merge medio
- 3g 22h
- PR unite (30g)
- 44
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di supabase/postgres
-
CREATE EXTENSION pgmq fails in Postgres 17.6.1.016+ due to function overload handling bug in after-create scriptForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
supabase/postgres#1867 · 14 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
supabase/postgres#1586 · 1 commento · 2 reazioni ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 2 giorni
-
supabase_auth_admin can CREATE rolesForse già presa @jaysomani l’ha presa 53 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
supabase/postgres#1518 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di supabase/postgres
Issue simili
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 62/100
gnocchixyz/gnocchi#1527 ·
I maintainer di solito rispondono entro 1 giorno
-
SQLAlchemy 2.0 cleanup: drop_all bind, dead metadata.bind, sql_query read-onlyForse già presa @dr-rodriguez l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
astrodbtoolkit/AstrodbKit#112 ·
-
[BUG] Cloudflare KV binding 模式下 kvDriver.list() 沿用 EdgeOne 语义,字段名不匹配导致 key 格式下初始化 500 并耗尽 list 配额Forse già presa @wumingzhinu l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
OpenListTeam/OpenList-Worker#125 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
components-web-app/docs#227 ·