Repository navigation
Conversation
…te counts record_field_provenance (13 arguments) and increment/decrement_vote_count are SECURITY DEFINER with no caller check, and the default privileges let anon run them. Their only callers run as the owner. This is the function-grant part of #520's privacy_round_two, ahead of its column changes. Refs #520
🤖 Triage: Class C →
|
🛑 Class C — this touches a danger layerPer the constitution (Development Workflow) danger-layer changes are spec-driven. Before this can merge, a maintainer must:
This gate is here because a small-looking diff to |
|
Applied 2026-11-19 by @nadernik in the SQL editor. Checked afterwards from the CLI: all three functions now grant EXECUTE only to |
In production today, anyone with the site's public key can call three SECURITY DEFINER functions that have no caller check:
record_field_provenance(13 arguments) writes a provenance claim at any grade on any cell. A claim at a verified grade makesenforce_field_provenancerefuse later machine updates of that cell.increment_vote_count/decrement_vote_countmove any suggestion's vote count with triggers off, so nothing is audited.The only callers are migrations and two SECURITY DEFINER functions (
confirm_species_candidate,provenance_mark_verified), which run as the owner. Nothing insrc/orsupabase/functions/calls them, and no trigger does. So onlyservice_rolekeeps EXECUTE.This is the function-grant part of
20261118120000_privacy_round_twoin #520, taken ahead of that file's column changes, which have to wait for the front end. Re-running either file is harmless.Checked (read-only, 2026-11-19):
data_audit_loghas no anon write outsideaccess_requests, andfield_provenancehas no unattributed claim outside the August backfills and imports. I found no sign that either function was misused.To apply: SQL editor, project
vpexxhfpvghlejljwpvt. The last statement should showanon = falseandauthenticated = falsefor all three.Refs #520