SIGSEGV in backend when authenticator role (supautils+safeupdate preloaded) hits a denied-EXECUTE call
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
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
- 派生
- 270
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 47
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
supabase/postgres 的其他 Issue
-
CREATE EXTENSION pgmq fails in Postgres 17.6.1.016+ due to function overload handling bug in after-create script可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
supabase/postgres#1867 · 14 条评论 · 2 个 reaction ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
supabase/postgres#1586 · 1 条评论 · 2 个 reaction ·
维护者通常 2 天内回复
-
NULLs don't show clearly on test outputs可能已有人在做 @alpacadev1 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
supabase/postgres#1568 · 1 条评论 ·
维护者通常 2 天内回复
-
supabase_auth_admin can CREATE roles可能已有人在做 @jaysomani 于 58 天前认领。 未关闭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 一周以上 新手友好度 30/100
维护者通常 2 天内回复
查看 supabase/postgres 的全部 Issue
相似的 Issue
-
good first issue help wanted v3
难度 2/5 1-3 小时 新手友好度 77/100
oras-project/oras-go#1621 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
HarperFast/harper#3275 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 2 天内回复