Skip to content

Fix: Restore and enforce RLS policies across all tables - #37

Open
mertcano wants to merge 1 commit into
circlefin:masterfrom
mertcano:zoba
Open

Fix: Restore and enforce RLS policies across all tables#37
mertcano wants to merge 1 commit into
circlefin:masterfrom
mertcano:zoba

Conversation

@mertcano

Copy link
Copy Markdown

This PR patches a critical security issue where RLS was temporarily disabled for development. Leaving it disabled exposes the database to the public anon key.

Added a new migration to lock down the database for production. The migration:

Revokes dangerous wildcard privileges from the anon role.

Re-enables RLS on profiles, wallets, transactions, escrow_agreements, and dispute_resolutions.

Drops the permissive dev policies and replaces them with strict auth.uid() = user_id ownership checks.

Adds proper multi-party access checks using EXISTS for the escrow and dispute tables.

No application code changes are needed, this just secures the database schema.

This PR patches a critical security issue where RLS was temporarily disabled for development. Leaving it disabled exposes the database to the public anon key.

Added a new migration to lock down the database for production. The migration:

Revokes dangerous wildcard privileges from the anon role.

Re-enables RLS on profiles, wallets, transactions, escrow_agreements, and dispute_resolutions.

Drops the permissive dev policies and replaces them with strict auth.uid() = user_id ownership checks.

Adds proper multi-party access checks using EXISTS for the escrow and dispute tables.

No application code changes are needed, this just secures the database schema.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant