Cannot revoke anon/authenticated write access on public.spatial_ref_sys — REVOKE as postgres silently does nothing #52113
Replies: 4 comments
|
You need to reinstall postgis in the proper extensions schema (default setting). |
|
Supabase documents this case on its PostGIS page, under Troubleshooting, "Security advisor flags public.spatial_ref_sys": https://supabase.com/docs/guides/database/extensions/postgis The cause is PostGIS being installed in The page gives two ways:
For what it's worth, Supabase's page calls this "expected, not a data exposure risk", because the table holds coordinate system definitions, not your data. |
|
The fix above (move PostGIS out of The relacl shows To check any revoke actually worked, look at grantors, not just select a.grantee::regrole, a.grantor::regrole, a.privilege_type
from pg_class c, aclexplode(c.relacl) a
where c.oid = 'public.spatial_ref_sys'::regclass
order by 1, 3;Any row whose grantor isn't you is one you can't revoke. That needs the owner, support, or moving the object out of the exposed schema. |
|
You diagnosed it correctly, and the diagnosis is the answer: the grants you need removed were made by Why every path you tried is closed
The supported fix is the same request you already made, with the revoke as a migration rather than a paragraph. The statement support should run, and the evidence that makes it a two-minute ticket: revoke insert, update, delete on table public.spatial_ref_sys from anon, authenticated;
revoke all on function public.st_estimatedextent from anon, authenticated;Include the What you can do right now, without the ticket, in order of usefulness
What the platform change from 30 October means for this table, since it is adjacent The change removed automatic grants on newly created public tables; One expectation-setting note The platform owner of that table runs the same revoke as a managed migration; there is no client-side sequencing that reproduces it. Meanwhile the alert in step 1 plus the repro in step 3 are what I would hold myself to until the ticket closes. |
Uh oh!
There was an error while loading. Please reload this page.
Summary: anon and authenticated hold INSERT/UPDATE/DELETE on
public.spatial_ref_sys and I cannot revoke them as postgres.
Impact: the table is writable through the Data API with the public anon key.
We use PostGIS geography for delivery distances, so an anonymous write to the
SRID table would break delivery pricing. Ongoing.
Expected behaviour: the API roles should not hold write privileges on a
PostGIS system table.
Actual behaviour: relacl shows
anon=arwdDxtm/supabase_admin, authenticated=arwdDxtm/supabase_admin,
owner supabase_admin.
Steps to reproduce:
-> still true
Troubleshooting completed: REVOKE as postgres completes without error and
changes nothing (postgres is neither the grantor nor a superuser).
ALTER TABLE ... ENABLE ROW LEVEL SECURITY fails on ownership. All
application tables are already RLS-protected and verified against the Data
API. Dropping PostGIS is not an option — orders.delivery_coords,
active_deliveries.last_known_coords, delivery_zones.boundary and
fulfillment_nodes.location are geography columns.
Environment: project qeuwnzzvzcvfxtwqemri, region ap-northeast-2,
Postgres 17.6.1.084, PostGIS in the public schema.
Request: revoke INSERT, UPDATE, DELETE on public.spatial_ref_sys from anon
and authenticated. Same for EXECUTE on the three
public.st_estimatedextent overloads, unless they must stay public.
All reactions