fix(account): bind managed group forwarding key UserID to the canonical member address - #527
Open
SashaMIT wants to merge 1 commit into
Open
fix(account): bind managed group forwarding key UserID to the canonical member address#527SashaMIT wants to merge 1 commit into
SashaMIT wants to merge 1 commit into
Conversation
…al member address Commit 332003c hoisted the forwardee key UserID derivation (getEmailFromKey(forwardeePublicKey) ?? email) so both internal branches take the email embedded in the member's self-asserted primary key. The private/other-org branch is self-healing: acceptGroupInvitation compares the extracted email against the real forwardee address and calls cloneKeyAndChangeUserIDs on mismatch. The managed branch has no activation step and no equivalent correction, so a forwarded ready-to-use key can be persisted whose UserID asserts an address other than the one it is issued for. Pass canonicalEmail as the UserID on the managed path (both the v1 addGroupMemberApi and v2 addGroupMemberKeysApi variants), matching what the key is actually bound to. The private path is unchanged because its activation flow performs the rebind.
mmso
force-pushed
the
main
branch
2 times, most recently
from
August 12, 2026 08:17
d9d8f8f to
95ce65c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since 332003c,
addGroupMemberderives the forwarded key's UserID from the email embedded in the member's own primary public key:The two internal branches diverge in what happens when that embedded email does not match the address being added:
ActivationToken, andacceptGroupInvitationexplicitly re-checksextractedEmail !== forwardeeEmailand callscloneKeyAndChangeUserIDsto rebind the key. Self-healing.emailother than the address it is actually bound to, which surfaces in clients, audit views, and anywhere the key UserID is taken as identity.Fix
On the managed path only, pass the canonical member address as the UserID — the address the key is actually issued for:
Applied to both variants of the flow (
addGroupMemberApiandaddGroupMemberKeysApi). The private path is intentionally unchanged: its activation flow performs the rebind, and preserving the key's own UserID there avoids a behavior change ahead of it.Verification
tsc --noEmiton the edited file: identical diagnostic set before/after (17 pre-existing module-resolution errors from a shallow checkout without workspace install; zero errors attributable to this change). The diff uses only in-scope identifiers.Made with Cursor