KI-023 Security-Definer Search-Path Plan
This checkpoint closes the remaining search-path exposure in trigger-sync functions generated for registered PostgreSQL source tables.
Invariants
- Every pgGraph
SECURITY DEFINERfunction executes withpg_catalogbefore the explicitly listedpg_tempschema, preventing implicit temporary-schema precedence for relation and type lookup. - Dynamically generated row and truncate trigger functions qualify pgGraph relations and cannot resolve attacker-controlled functions from the caller’s search path.
- Metadata audits cover both extension-defined entrypoints and generated trigger functions.
- Trigger synchronization behavior and SQL contracts remain unchanged.
Ordered Checkpoints
- Pin generated row and truncate trigger functions to
pg_catalog, pg_temp. - Add a unit assertion over generated SQL.
- Add a PostgreSQL-backed shadow-schema regression that proves source DML cannot invoke an attacker-controlled advisory-lock function.
- Harden caller-role and graph-admin checks against temporary relations and persistent function/operator shadows.
- Extend the function metadata release gate to create and audit generated trigger functions.
- Update public security, release, known-issue, and contributor documentation.
Exit Evidence
- [x] Generated trigger functions expose
search_path=pg_catalog, pg_tempinpg_proc.proconfig. - [x] A caller-controlled shadow schema cannot intercept trigger execution.
- [x] Temporary catalog relations and persistent function/operator shadows cannot bypass graph-admin authorization.
- [x] The metadata audit and focused PostgreSQL regression pass.
- [x] Independent Rust review reports no KI-023 blocker.