#50947·supabase

Cannot revoke anon/authenticated EXECUTE on net schema (pg_net) — REVOKE silently no-ops due to supabase_admin ownership

Author: muruganmse-hubCreated Sep 27, 2026Updated Sep 27, 2026
Labelsexternal-issueto-triage

Context

Security review flagged that anon/authenticated retain EXECUTE on net.http_post/net.http_get (and USAGE on the net schema itself). This is a potential SSRF vector if that schema is ever reachable via the Data API — the database could be made to issue arbitrary outbound HTTP requests.

What we observed

Both the net schema and its functions are owned by supabase_admin. Our project's postgres role has no membership in supabase_admin and no grant-option over the existing grants, so we cannot revoke them ourselves:

sql
-- Attempt 1: function-level revoke
REVOKE EXECUTE ON ALL FUNCTIONS IN SCHEMA net FROM anon, authenticated;
-- Completes with no error, but has_function_privilege() confirms the grant is unchanged.

-- Attempt 2: schema-level revoke
REVOKE USAGE ON SCHEMA net FROM anon, authenticated;
-- Same silent no-op — schema owner is also supabase_admin (confirmed via pg_namespace.nspowner).

We also tried the drop/recreate approach sometimes suggested for non-relocatable extensions (inside a transaction, rolled back before committing, so nothing was actually changed):

sql
BEGIN;
DROP EXTENSION pg_net;
CREATE EXTENSION pg_net;
-- freshly recreated extension and its objects are immediately re-owned by supabase_admin again, not postgres
ROLLBACK;

This didn't help either — ownership is reset to supabase_admin regardless of who runs CREATE EXTENSION.

What we've already ruled out

  • postgres role membership: confirmed not a member of supabase_admin (via pg_auth_members), so no SET ROLE escalation path exists on our side.
  • Confirmed these are direct grants to anon/authenticated (via information_schema.role_table_grants), not inherited via PUBLIC.
  • Confirmed via a direct REST API request (with a real anon key) that net.http_post currently returns 404 — the net schema isn't in our project's exposed-schemas list, so the grant isn't exploitable through the standard Data API today. But the underlying grant is still wrong, and would become exploitable immediately if exposed-schemas config ever changes, or if a function we add later calls net.http_* without realizing the broad grant already exists.

Relation to #46919

#46919 covers the extension_in_public advisory (extension's pg_extension.extnamespace pointing at public) and has a documented Support-assisted fix. That's a different, narrower problem — relocating the extension's namespace doesn't touch the EXECUTE/USAGE grants described here, since net.http_* already lives in the net schema regardless of where the extension itself is registered. We couldn't find an existing issue covering the grant problem specifically.

Request

  • Is there a supported way for a project's postgres role to manage grants on supabase_admin-owned objects like net, short of a Support ticket per project?
  • If not, please treat this report as a request for Supabase to default anon/authenticated grants on pg_net functions to none (or service_role-only) on new and existing projects, rather than requiring each project to file a support ticket individually.

Happy to provide more detail if useful.