0002_auth_users_exposed false positive: pg_depend join lacks a refclassid filter (cross-catalog OID collision)
维护者通常 1 天内回复
评估
调研方向
从 lints/0002_auth_users_exposed.sql 开始,检查 issue 中描述的 pg_depend join。使用报告中的诊断查询重现跨 catalog 的 OID 冲突。当 lint 不再报告依赖仅为 pg_proc 对象的 view,同时仍能检测到对 auth.users 的 relation 依赖时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Summary
lints/0002_auth_users_exposed.sql joins the view's rewrite dependencies to auth.users by OID only:
join pg_catalog.pg_depend d
on d.refobjid = auth_users_pg_class.oid
There is no d.refclassid = 'pg_catalog.pg_class'::regclass predicate, so any pg_depend row from a view's rewrite whose refobjid numerically collides with auth.users' pg_class OID — but actually references an object in a different catalog (pg_proc, pg_type, …) — fires the lint.
Observed instance
On one of our projects, auth.users has pg_class OID 16499, and a public view calls a SECURITY DEFINER helper function whose pg_proc OID is also 16499. The view selects only from public tables (verified: zero relation dependency on auth.users), yet the advisor reports it as CRITICAL auth_users_exposed, and the "action required: security vulnerabilities" email goes out weekly.
Diagnostic query that shows the collision:
with au as (
select oid from pg_class
where relname = 'users' and relnamespace = 'auth'::regnamespace
),
rw as (
select oid from pg_rewrite where ev_class = 'public.<your_view>'::regclass
)
select d.refclassid::regclass as ref_catalog,
case when d.refclassid = 'pg_proc'::regclass then d.refobjid::regprocedure::text
when d.refclassid = 'pg_class'::regclass then d.refobjid::regclass::text
else d.refobjid::text end as ref_object,
d.deptype
from pg_depend d, au, rw
where d.objid = rw.oid and d.refobjid = au.oid;
Result on the affected project: one row, ref_catalog = pg_proc, ref_object = <helper function>(text,uuid) — not a relation.
Suggested fix
Add the catalog filter to the join:
join pg_catalog.pg_depend d
on d.refobjid = auth_users_pg_class.oid
and d.refclassid = 'pg_catalog.pg_class'::regclass
(Other OID-equality joins in the lint suite may want the same audit.)
- 主要语言
- 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 天内回复
-
难度 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 于 9 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
维护者通常 1 天内回复
-
Proposal: lint for RLS policies whose role lacks the table privilege (policy_without_privilege)可能已有人在做 @larik15 于 29 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 1/100
维护者通常 1 天内回复
-
0028/0029 silently report zero findings for projects using a custom PostgREST request role可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 68/100
维护者通常 1 天内回复
查看 supabase/splinter 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
nopSolutions/nopCommerce#8439 ·
维护者通常 1 天内回复
-
bug:new
难度 2/5 1-3 小时 新手友好度 78/100
callstackincubator/simlock#1234 · 1 条评论 ·
维护者通常 1 天内回复
-
🐛 Bug: node-sqlite3 example fails on values that contain a quote可能已有人在做 @RaphaelFakhri 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
mochajs/mocha-examples#130 ·
-
`HandleEmptyInListsPlugin` / `SafeNullComparisonPlugin` skip expressions nested in `eb.selectFrom(...)` subqueries可能已有人在做 @superbot-helper 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
kysely-org/kysely#2216 · 1 条评论 ·
维护者通常 1 天内回复