Repository navigation
fix: remove anon read access to interfaces_feedback - #52534
Conversation
Clients only submit and delete feedback, so a leaked delete token should not be usable to read a submission. Reset anon/authenticated privileges and grant anon only what token-scoped deletes need: delete, plus select on delete_token. Generated with AI Co-Authored-By: Claude <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Updates to Preview Branch (kanad-claude/remove-anon-read-path-a941f2) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
Walkthrough
Merge Risk:
|
Braintrust eval report
|
Problem
The CLI (supabase/cli#5988) and MCP server (supabase/mcp#474) only submit and delete feedback. Neither reads it back. But
anoncan still read a row's feedback text with its delete token, so a leaked token exposes the submission.Linear: CLI-2406
Solution
New migration on
public.interfaces_feedback:anonandauthenticated, then grantanononlydeleteandselect (delete_token).delete_tokencolumn comment to say it authorizes deletes only.Key choices:
select (delete_token)stay. Clients delete with adelete_token=eq.<token>filter. A filtered delete needs select on the filtered column and must pass the select policy. Tested locally: revoking the grant makes deletes fail with42501, and dropping the policy makes them silently match 0 rows.anongets every table privilege by default, which overrides column-level grants. Starting fromrevoke allgives the same end state everywhere.No client changes are needed. The delete policy and
submit_interfaces_feedbackare unchanged.Review instructions
Run these against a local stack (
supabase db reset) or this PR's preview branch. Replace the placeholders:<PROJECT_URL>: for examplehttp://127.0.0.1:54321<ANON_KEY>: the project's anon key<DELETE_TOKEN>: the token returned in step 1 or 5Submit feedback. The response is the delete token.
Try to read the feedback with the token. Expect
401with code42501.Only
select=delete_tokensucceeds. Every other column returns42501.Delete without the token header. Expect
Content-Range: */0.Delete with the token header. Expect
Content-Range: */1.Submit feedback with a project ref and user ID.
Delete with only the token header. Expect
Content-Range: */0.Delete with all three headers. Expect
Content-Range: */1.Optional: run
supabase feedback addandsupabase feedback deleteagainst this PR's preview branch. Both succeed (already confirmed).🤖 Generated with Claude Code