You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4f99860
Browse filesBrowse the repository at this point in the historyBrowse files
fix(plugin-security): row-scope sys_invitation read to its addressee; keep the full ledger with owner/admin (#8095) (#8242)
* fix(plugin-security): row-scope sys_invitation read to the addressee (#8095)
A plain org member could read every sys_invitation row of the org through the
data API — other invitees' email addresses, the role each was about to be
granted, the inviter and the expiry — because the BETTER_AUTH_MANAGED_OBJECTS
blanket grants allowRead on every managed identity table while neither
member_default nor viewer_readonly declared a row policy for this object, and
an object with no applicable policy compiles to a null Layer 1.
member_default and viewer_readonly each gain sys_invitation_self
(select, email == current_user.email). The full ledger stays with
owner/admin via organization_admin's sys_invitation_org. The object-level read
bit is deliberately left open so the addressee still reads their OWN row — the
accept/reject row actions are gated on record.email == ctx.user.email, so
closing the object would break acceptance while looking like the same fix.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PEVB6w7D7uCszR9Mw1BL73
* fix(plugin-security): keep the org-admin invitation read whole on the wall-less posture (#8095)
The member-side row scope reaches org admins too — member_default resolves for
every authenticated principal via the everyone anchor — and on the DEFAULT
single posture neither mechanism that normally keeps an admin whole is present:
ADR-0105 D4 withholds the viewAllRecords short-circuit from a wall-less
deployment (organization_admin_no_bypass), and ADR-0105 D3 strips
sys_invitation_org as a platform tenant policy when org isolation is inactive.
Measured on a stock boot with only the member-side scope: the org OWNER read
zero invitations. organization_admin now states the admission in its own right
as sys_invitation_org_admin, positions-domained to org_owner/org_admin with a
predicate carrying no tenant token for the strip to key on. The domain only
ever widens, so a principal it does not match keeps the addressee scope and
fails closed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PEVB6w7D7uCszR9Mw1BL73
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments