security(follow-up): registry.CanCommunicate treats any two org-roots as siblings (Discover/CheckAccess org-root<->org-root) — residual of #1953 #1955

Closed
opened 2026-05-27 15:47:58 +00:00 by hongming · 0 comments
Owner

Residual cross-tenant weakness found while fixing #1953 (PR #1954).

#1954 scopes the three leaking paths (discovery.Peers, mcp_tools.toolListPeers, a2a_proxy) to the caller org via the org-root parent_id CTE. But registry.CanCommunicate itself still treats ANY two org-roots as siblings (parent_id IS NULL = all roots), so discovery.Discover and CheckAccess retain the same root-sibling weakness for the org-root<->org-root case (two top-level workspaces in different orgs can pass CanCommunicate).

Fix options: (a) scope CanCommunicate itself with the same org-root CTE (orgRootID/sameOrg in the new org_scope.go), or (b) the pending org_id column on workspaces (denormalized) so org checks are a cheap WHERE org_id=? everywhere. Option (b) is the deferred architecture decision; (a) is a contained fix in the meantime.

Related: #1953, PR #1954, OFFSEC-015 (5a05302c). Filed per CTO directive to file follow-ups for problems found.

Residual cross-tenant weakness found while fixing #1953 (PR #1954). #1954 scopes the three leaking paths (discovery.Peers, mcp_tools.toolListPeers, a2a_proxy) to the caller org via the org-root parent_id CTE. But registry.CanCommunicate itself still treats ANY two org-roots as siblings (parent_id IS NULL = all roots), so discovery.Discover and CheckAccess retain the same root-sibling weakness for the org-root<->org-root case (two top-level workspaces in different orgs can pass CanCommunicate). Fix options: (a) scope CanCommunicate itself with the same org-root CTE (orgRootID/sameOrg in the new org_scope.go), or (b) the pending org_id column on workspaces (denormalized) so org checks are a cheap WHERE org_id=? everywhere. Option (b) is the deferred architecture decision; (a) is a contained fix in the meantime. Related: #1953, PR #1954, OFFSEC-015 (5a05302c). Filed per CTO directive to file follow-ups for problems found.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#1955