SIGSEGV in backend when authenticator role (supautils+safeupdate preloaded) hits a denied-EXECUTE call
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
Start by reproducing the isolated denied-EXECUTE call with supautils and safeupdate preloaded, then compare it with each library loaded alone. Trace the backend failure from the denied function call; done means the call returns 42501 and the backend connection remains usable.
索引モデルが issue の本文から書いたものです。
説明
Bug report
Calling a function you've been denied EXECUTE on crashes the backend connection
with SIGSEGV instead of returning a clean 42501, when the connecting role has
BOTH supautils and safeupdate in session_preload_libraries — exactly the
authenticator role's default configuration, i.e. what PostgREST uses for
every request via SET ROLE anon/authenticated.
Environment
- Local Supabase CLI stack (
supabase start), Postgres 17.6 - Nix-packaged build:
.../postgresql-and-plugins-17.6/bin/.postgres-wrapped
Reproduction (isolated, trivial function, no app logic involved)
CREATE FUNCTION test_trivial() RETURNS int LANGUAGE sql AS $$ SELECT 1 $$;REVOKE EXECUTE ON FUNCTION test_trivial() FROM <role>;(schema USAGE still granted)- Connect as
authenticator(session_preload_libraries = 'supautils, safeupdate'),
SET ROLE anon;(or any role denied EXECUTE on the function) SELECT test_trivial();- Connection dies instantly: "Connection terminated unexpectedly" client-side.
Isolation results
supautilsalone preloaded, same denied call → clean42501, no crash.safeupdatealone preloaded, same denied call → clean42501, no crash.- Both together (matching
authenticator's real config) → SIGSEGV, 100% reproducible
on the first call, regardless of function body (tested plain SQL and SECURITY
DEFINER; not specific to either).
Server-side evidence
dmesg inside the container shows, identically on every occurrence:
segfault at 0 ip <consistent offset> sp ... error 4 in .postgres-wrapped[...]
.postgres-wrapped: potentially unexpected fatal signal 11.
segfault at 0 = NULL-pointer dereference. pg_postmaster_start_time() is
unchanged across every crash — only the individual backend dies, not postmaster.
Ruled out OOM: host VM had 8.8GB free, zero OOM-killer lines in dmesg across the
whole session.
Why this matters
authenticator's preload-library combination is presumably the Supabase default
across all projects. Any real PostgREST request that correctly gets EXECUTE-denied
(a perfectly normal authorization outcome, not misconfiguration) will crash the
backend instead of returning 403, on any project using this default.
Happy to provide the full investigation transcript or test further if useful.
- 主要言語
- Nix
- スター
- 1.8k
- フォーク
- 268
- 平均マージ
- 3日 22時間
- マージ済み PR(30日)
- 44
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
supabase/postgres のほかの issue
-
CREATE EXTENSION pgmq fails in Postgres 17.6.1.016+ due to function overload handling bug in after-create script再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
supabase/postgres#1867 · コメント 14 件 · リアクション 2 件 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
supabase/postgres#1586 · コメント 1 件 · リアクション 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 2 日以内に返信
-
supabase_auth_admin can CREATE roles対応中かも @jaysomani が 54 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
supabase/postgres#1518 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
`supabase/postgres:17.6.1.105` (amd64) — backend SIGSEGV during a heavy pgTAP file, CI-CPU-specificオープン
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
メンテナーはふだん 2 日以内に返信
supabase/postgres の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ClickHouse/clickhouse-go#2066 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
peasant-labs/village#293 ·
メンテナーはふだん 1 日以内に返信
-
RBatch fails with IllegalArgumentException: Self-suppression not permitted when all commands fail with the same exception対応中かも @yngyu が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 4 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
crate/sqlalchemy-cratedb#325 ·
メンテナーはふだん 6 日以内に返信