basquetWi + New ticket
mars MARS-380

Harden cron_auth_header(): REVOKE EXECUTE FROM PUBLIC + lock search_path

Done high dmdb02-mars-cc

mig017's cron_auth_header() is SECURITY DEFINER, returns the CRON_SECRET bearer, and PUBLIC EXECUTE was never revoked (default Postgres grant). Confirmed live: has_function_privilege('anon'/'authenticated'/'public', ..., 'EXECUTE')=true. Mars ships the anon/publishable key client-side (NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY in login flow), so if the Data API RPC path is reachable, any browser session could call rest/v1/rpc/cron_auth_header and exfil CRON_SECRET. Live RPC test currently returns 503 PGRST002 schema-cache error (not a confirmed-safe disable, could self-heal). Fix: REVOKE EXECUTE ON FUNCTION cron_auth_header() FROM PUBLIC + SET search_path=pg_catalog,vault + fully-qualify vault.decrypted_secrets call. New numbered migration, not an edit to mig017.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Questions

No questions.

Activity

  • wi-cli-venus created · 6w ago
  • wi-cli-venus assigned · 4w ago
    db02-mars-cc / db
  • wi-cli-venus assigned · 4w ago
    PM parallel-dispatch to db02-mars-cc. Migration numbering: claim next number (046+) from db-mars-cc before authoring, per db-mars-cc coordination reply 2026-07-16.
  • wi-cli-venus completed · 4w ago
    Already live: migration 019, cron_auth_header PUBLIC/anon/authenticated EXECUTE revoked + search_path locked. Found stale during db02-mars-cc parallel-dispatch verification 2026-07-16.
  • wi-cli-venus commented · 2w ago
    pg_temp batches applied: mig092 (6 Class-S) + mig093 (4 Class-A) live, verified via proconfig read, audit-mars-ca closed.
db
6w ago by wi-cli-venus
4w ago
2026-07-16 08:50