Repository navigation
Description
Split from #3590 after security, product, and data-model review of the person-identity contract.
Problem
Authentication currently resolves a linked non-primary WorkOS credential through the identity's primary WorkOS user. Organization membership and capability reads can therefore use the canonical user rather than the credential that actually authenticated. The existing merge path also rewrites and deduplicates organization-membership rows onto that canonical user.
That can turn identity linkage into an unintended union of organization access. Unlinking later creates an empty singleton identity and does not restore the original membership provenance.
Required behavior
- Resolve organization authorization from
(authenticated credential, explicitly selected organization). - Require an active, unrevoked organization membership or credential-use grant for that exact authenticated credential and organization.
- Treat
identity_id, the primary credential, other linked credentials, affiliations, and personal subscriptions as non-inputs to organization authorization. - Return 403 for an unauthorized selected organization; never fall back to a primary, first, or arbitrary organization.
- Keep membership IDs, roles, seats, grantors, effective dates, and provider membership provenance unchanged during identity attachment, merge, promotion, unlink, or split.
- Recheck the same resolved organization context in queries and mutation tools.
- Bump a persisted authorization/session epoch transactionally when identity bindings change; cache eviction alone is not the revocation mechanism.
- Separate credential binding from state consolidation. Disable destructive consolidate/promote/automatic-alias paths, or keep them legacy operator-only, until they preserve authority and provenance.
- Roll back upstream WorkOS membership changes if local identity mutation fails.
Acceptance criteria
- Signing in with linked credential A cannot reach an organization granted only to credential B.
- An explicit organization-approved grant can authorize credential A without copying or rewriting B's membership.
- No-organization and unauthorized-organization requests fail closed and never choose an implicit organization.
- Link, attach, primary promotion, unlink, and split leave organization membership rows and provenance unchanged.
- Stale sessions/context caches lose pre-change authority through a persisted epoch check.
- Partial-failure tests prove upstream WorkOS changes are compensated.
- Cross-organization abuse, concurrent binding changes, replay, and stale-cache tests pass.
Dependencies
- Ownership/provenance contract: Person identity: define ownership, provenance, and lifecycle of portable state #6487
- Reversible operation model: Admin identity merge/split: make credential linking genuinely reversible #6490
- Cross-surface privacy fence: Identity privacy fence: consent and authorization rules for cross-surface linking #6491
This must land before #6817 exposes self-service recovery credentials or any identity-owned read model assumes linked credentials are authorization-safe.
Activity
bokelley commentedon Aug 24, 2026
Triage
Status: ready-for-human
Class: Normative — reverses a shipped precedent; requires a decision memo and WG ratification
Milestone: Evergreen
Two independent security advisors reviewed the threat model and acceptance criteria for this issue. Both confirm:
1. The gap is real. The authentication architecture currently allows a linked non-primary credential, in certain conditions, to resolve organization authorization through the identity's primary credential rather than its own direct membership. This is precisely the scenario described: identity linkage can produce an unintended union of organization access. The threat model is not speculative.
2. The proposed invariant is sound. Scoping organization authorization strictly to
(authenticated credential, explicitly selected organization)is the right fix. The necessary preservation primitive is already present on the request object — the enforcement layer just does not use it consistently across all resolution paths today.3. The acceptance criteria are directionally correct but need elaboration before this is implementer-ready:
identity_idat time of action — not either-or.4. Ordering: this must land with or before #6490 (which states the invariant that #6827 enforces at the server) and before #6817 (self-service recovery via linked credentials is only safe once org authorization is scoped to the recovering credential).
Governance: Normative. The proposal narrows behavior established by a prior shipped decision on identity linkage. A Normative-class decision memo per
governance/decisions/README.mdis the right vehicle. @bokelley — because this narrows a decision of record, ratification from you is recommended over standard Secretariat routing.My take: Real gap, right invariant, enforcement primitive already exists on the request — the authorization layer just doesn't consistently use it; write the decision memo against the prior shipped decision, ship with #6490, land before #6817.
Generated by Claude Code
bokelley commentedon Aug 25, 2026
Reclassifying this as an application authorization/security bug rather than a protocol change.
The required invariant is already the expected security boundary: organization access is authorized from the exact authenticated credential plus an explicitly selected organization. The change does not alter AdCP schemas, wire behavior, or implementer obligations; it corrects how this server applies authentication and organization membership internally.
Rollout is deliberately staged to minimize compatibility risk:
The identity-model dependencies remain useful context, but they do not require working-group ratification for this application-layer authorization repair.
fix(admin): report working-group overlap in the promote gate
fix(auth): bump every bound credential when the primary flips
feat(auth): persist the authorization epoch for identity bindings (#7001
fix(admin): let the promote UI confirm a consolidation
fix(admin): require stated intent before promote deletes memberships (#…
fix(orgs): contain organization merge and its operator bypasses (#6827)
fix(orgs): make organization deletion temporarily unavailable (#6827)
fix(orgs): make organization deletion temporarily unavailable (#6827)
fix(orgs): make organization deletion temporarily unavailable (#6827) (…
fix(orgs): contain organization merge and its operator bypasses (#6827)
fix(orgs): contain organization merge and its operator bypasses (#6827)…
bokelley commentedon Sep 21, 2026
Triage execution update: routed to P0 Bugs. Keep this as the exact-credential authorization security umbrella. The immediate sequencing gate is #7514; after that lands, refresh and human-review the staged containment PRs against current main before enabling any rollout.