fix(gateway): a Meta-Edge SSO login is not a mesh operator (BLOCKER-B, write half)#98
Open
darw007d wants to merge 1 commit into
Open
fix(gateway): a Meta-Edge SSO login is not a mesh operator (BLOCKER-B, write half)#98darw007d wants to merge 1 commit into
darw007d wants to merge 1 commit into
Conversation
…, write half) The shipped _is_operator was `return auth.peer is None`. Both a verified SSO identity context (kind='user_identity') and a cell-join key (kind='cell_join') carry peer=None — only the genuine shared/commander token has peer=None AND kind=None. So once the Meta-Edge verifier is live, every OAuth login resolved to a full operator: a stranger completing "Sign in with GitHub" would get a valid RS256 identity JWT and pass every _is_operator gate (announce/reserved channel create, service/lane/fleet control, context push) — an OAuth-driven operator factory. The cell-join context had the same hole. Close it precisely: operator == peer is None AND kind is None. A Meta-Edge context (user_identity or cell_join) is owner-scoped, never operator. Not live-exploitable today: the deployed :8788 (mesh-gateway) has no Meta-Edge code path yet (see the two-gateways divergence), so no user_identity token is accepted. This must land in the SAME change that ports/migrates the verifier onto :8788 — wiring the verifier without this fix opens the factory. Tests (TDD, watched RED first): - unit: _is_operator True only for the shared token; False for user_identity, cell_join, and per-peer cells. - wiring: a user_identity token is 403'd at the announce-channel route (committed catch, not just a helper assertion); shared token still 200s. Full suite: 989 passed, 5 skipped. STILL OPEN (read half of BLOCKER-B, gates the migration — NOT in this PR): GET /messages applies ?to=/?from= from query params with no caller scoping, so a user_identity can read arbitrary DMs. Scoping it correctly requires resolving how a `sub` maps to the node-names it owns (the from_node:"commander" caller- binding reconciliation, plan STILL-OPEN #3). The migration must not activate the verifier on live :8788 until the read half closes too. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPQFrDwKBxzSSbopNLa2L8
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.
What
The shipped
_is_operatorwasreturn auth.peer is None. Both a verified SSO identity context (kind='user_identity') and a cell-join key (kind='cell_join') carrypeer=None— only the genuine shared/commander token haspeer=Noneandkind=None. So the moment the Meta-Edge verifier goes live, every OAuth login resolves to a full operator: a stranger completing "Sign in with GitHub" gets a valid RS256 identity JWT and passes every_is_operatorgate (announce/reserved channel create, service/lane/fleet control, context push). An OAuth-driven operator factory. The cell-join context had the identical hole.Fix: operator ==
peer is None AND kind is None. A Meta-Edge context is owner-scoped, never operator.Why it's safe to land now (and why it must land with the migration)
Not live-exploitable today: the deployed
:8788(mesh-gateway) has no Meta-Edge code path yet (the verifier lives only in this swarph-cli bundle — the two gateways have diverged). Nouser_identitytoken is accepted in production. This fix must land in the same change that migrates/ports the verifier onto:8788— wiring the verifier without it opens the factory.Tests (TDD — watched RED first)
_is_operatorTrue only for the shared token; False foruser_identity,cell_join, and per-peer cells.user_identitytoken is403'd at the announce-channel route (a committed catch, not just a helper assertion); the shared token still200s.GET /messagesapplies?to=/?from=from query params with no caller scoping, so auser_identitycan read arbitrary DMs. Scoping it correctly requires resolving how asubmaps to the node-names it owns (thefrom_node:"commander"caller-binding reconciliation — see the SSO plan's STILL-OPEN #3). The migration must not activate the verifier on live:8788until the read half closes too.🤖 Generated with Claude Code