Repository navigation
security: lock down functions, hide poster fingerprints, spatial_ref_sys read-only - #13
Merged
Merged
Conversation
…anon, lock spatial_ref_sys Applied to prod by hand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThreatCrush Security Scan3 finding(s) HIGH/CRITICAL: 1 | LOW: 2
Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the 2026-10-26 fleet SECURITY DEFINER audit (
icemap-app-supabase-db).3 exposed SECURITY DEFINER -> 0. These are the three PostGIS
st_estimatedextentoverloads inpublic, which were executable by anon and read planner statistics of any table.The app talks to Supabase only with the service role (
lib/supabase.tsrefuses to start without it), so the rest is defence in depth. Today the anon key is not shipped to browsers.create_post,record_post,get_or_create_anonymous_id,cleanup_*...) was executable by anon/authenticated. They are now service_role only.spatial_ref_syshas no RLS, and anon/authenticated could INSERT/UPDATE/DELETE it, which would break every geography transform. It is now read-only for them.posts.fingerprintandcomments.fingerprint/anonymous_idwere readable through the public SELECT policies. They link one poster's reports together, so anon/authenticated now get column grants without them.Applied by hand after a schema backup and a rolled-back dry run, followed by
notify pgrst. Live checks:posts?select=fingerprint-> 42501posts?select=id,summary-> 200rpc/can_user_post-> permission deniedspatial_ref_sys-> 42501icemap.app/api/posts(bounds) 200,/api/posts/nearby200,/api/me200. The test anonymous id was deleted.There are no app code changes.
🤖 Generated with Claude Code