Skip to content

Step 5: no row policy on auth.session, auth.account and auth.verification #57

Open

Description

@leandrotcawork

Found by the step 5 whole review (Opus, finding 13; Sonnet, finding 3), triaged Issue futura (delivery L12).

auth.session, auth.account and auth.verification have no row policy, and the scope roles hold table-wide grants on them:

  • hub_company: SELECT and UPDATE on auth.session (UPDATE narrowed to one column in PR 53).
  • hub_invitation: SELECT, INSERT and UPDATE on auth.session; SELECT and INSERT on auth.account; SELECT, INSERT and DELETE on auth.verification.

What a forgotten filter reads:

  • In the invitation scope, every person's password hash and every one-use link token.
  • In a company scope, every session.

Step 5's card polices only the four company tables and auth.user, so this is outside it. Before step 5, the login reached the same rows.

Trigger: before more scoped code arrives (step 6, or the Builder's generated queries reach the Hub's database).

Direction: user_id = person policies on the three tables, following the pattern auth.user already uses.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions