Mercury/src/db/migrations/002_blacklist_system_tables.sql
Matthew L McPeak 034cd4df8c
Some checks failed
ci / build-ui (push) Failing after 12s
ci / test (push) Failing after 51s
ci / publish (push) Has been skipped
Mercury
2026-06-17 15:11:51 -04:00

9 lines
671 B
SQL

-- Block PostgreSQL system catalog tables from the public CRUD API.
-- The pg_ prefix covers pg_tables, pg_class, pg_user, pg_shadow, pg_authid, etc.
-- information_schema columns contain dots so they're already rejected by the
-- identifier validator, but we block them here for defense in depth.
INSERT INTO blacklist (pattern, method, reason, active) VALUES
('/api/pg_*', NULL, 'postgresql system catalog', true),
('/api/pg_*/**', NULL, 'postgresql system catalog', true),
('/api/information_schema', NULL, 'postgresql information schema', true),
('/api/information_schema/**', NULL, 'postgresql information schema', true);