0025_public_bucket_allows_listing silently returns zero findings when splinter.public_buckets is unset — undocumented transaction-local contract
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
调研方向
从编译后的 splinter.sql 中的 0025_public_bucket_allows_listing query 及其前导部分开始,然后比较 splinter.json 中分开的 query 和 setup 字段。查看 README 以及 CI psql --single-transaction 的调用,以记录事务本地 GUC 合约。完成的标准是:缺少设置时不能静默地产生干净结果,并且行为要同时覆盖跳过 setup 和合法的空 bucket 列表。
由索引模型根据 Issue 内容生成。
描述
Summary
Since #170 ("chore: 0025 query_to_xml workaround", merged 2026-07-02), 0025_public_bucket_allows_listing no longer reads storage.buckets itself. The view now reads a GUC:
coalesce(
nullif(pg_catalog.current_setting('splinter.public_buckets', true), '')::pg_catalog.jsonb,
'[]'::pg_catalog.jsonb
)
and the storage.buckets read moved into a preamble DO block that exists only in the compiled splinter.sql, which populates the GUC transaction-locally:
perform pg_catalog.set_config('splinter.public_buckets', buckets, true);
Consequence: any consumer that executes the lint query without running that preamble in the same transaction gets zero findings — indistinguishable from a genuinely clean result. The lint fails open. #170 itself had to switch this repo's CI runner to psql --single-transaction to keep the GUC visible, which illustrates the hazard: the contract is real, but it lives only in the compiled artifact and CI invocation, and the README documents the pgrst.db_schemas dependency while splinter.public_buckets is undocumented.
Real-world impact (hosted advisor path)
On our hosted project, 0025 reported two findings (user-avatars, workspace-branding) through 2026-06-10. Sometime after #170, the findings disappeared from the hosted security-advisor results while both flagged conditions still hold — we re-verified by executing the lint's own predicate manually with the bucket list supplied: both broad PERMISSIVE SELECT policies still exist and both findings reproduce exactly. We can't inspect the hosted advisor runner, but the observable symptom is precisely what a runner that doesn't execute the preamble in-transaction would produce, and no other 0025-touching change exists in the window.
For an advisor whose job is to flag data exposure, "input not supplied" being indistinguishable from "no exposure found" seems worth closing: consumers (including us) read the absence of findings as a clean bill.
The same hazard is now formalized in the manifest
The versioned splinter.json manifest publishes per-lint query fields with a separate setup field. A consumer that runs a lint's query without executing setup in the same transaction reproduces the same silent zero for 0025.
Prior art
This is the same failure class as the unset-pgrst.db_schemas case (supabase/cli#5868, fixed by #168 coalescing to 'public'). The difference: 0025 has no sane inline default available — an empty bucket list doesn't degrade the lint, it disables it silently.
Suggestions
- Document the
splinter.public_bucketscontract in the README alongsidepgrst.db_schemas, including the transaction-local requirement. - Prefer fail-loud over fail-open: when the setting is absent (as opposed to a legitimately empty
[]), either raise, or emit a sentinel "not evaluated" row, so runners that skip the preamble become visible instead of silently green. - Alternatively, restore a self-contained fallback: read
storage.bucketsdirectly when the GUC is absent and thestorageschema exists (the pre-#170 behavior), using whatever construction avoids the originalquery_to_xmlproblem that motivated #170.
Happy to provide the manual reproduction steps or test against a fix.
- 主要语言
- PLpgSQL
- 星标
- 284
- 派生
- 110
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
supabase/splinter 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 69/100
supabase/splinter#206 · 1 个 reaction ·
维护者通常 1 天内回复
-
0002_auth_users_exposed false positive: pg_depend join lacks a refclassid filter (cross-catalog OID collision)可能已有人在做 @tushardev-365 于 95 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 40/100
supabase/splinter#210 · 1 个 reaction ·
维护者通常 1 天内回复
-
0030_autovacuum_disabled misses tables where autovacuum_enabled is set to off, 0 or no可能已有人在做 @RaphaelFakhri 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
维护者通常 1 天内回复
-
Proposal: lint for RLS policies whose role lacks the table privilege (policy_without_privilege)可能已有人在做 @larik15 于 27 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 1/100
维护者通常 1 天内回复
查看 supabase/splinter 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
microsoft/agent-framework#9946 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 62/100
rmax/scrapy-redis#337 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
Index conflicts report and internal error可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
chriskelly/wish-together#102 ·
维护者通常 1 天内回复