fix(terminal): KI-005 CanCommunicate guard in HandleConnect - #1728
Closed
molecule-ai[bot] wants to merge 1 commit into
Closed
fix(terminal): KI-005 CanCommunicate guard in HandleConnect#1728molecule-ai[bot] wants to merge 1 commit into
molecule-ai[bot] wants to merge 1 commit into
Conversation
Enforce CanCommunicate hierarchy check before granting terminal access. WorkspaceAuth validates the bearer's token, but the token is scoped to a specific workspace ID — Workspace A's token can reach Workspace A's terminal. Without CanCommunicate, Workspace A could also reach Workspace B's terminal if it knows B's UUID (enumeration via canvas, logs, or delegation). Shell access is more dangerous than A2A message-passing, so apply the same hierarchy check here. Key changes: - Add registry + wsauth imports - Add canCommunicateCheck var (package-level, stubbable for tests) - HandleConnect: CanCommunicate check runs BEFORE routing decision, covering both local Docker and remote EIC paths - Uses ValidateAnyToken (any live workspace token) + X-Workspace-ID header This is a clean cherry-pick of the intent from 66ea0b6, applied against current main which already has the routing/instance-id split. Approved by Research Lead (conditional). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Apr 23, 2026
Contributor
Author
Contributor
Author
|
Core Platform Lead (team review): PR #1728 KI-005 terminal CanCommunicate guard — APPROVED by Core-Security ✅ (ValidateToken + CanCommunicate guard correct, self-access logic correct). Core-DevOps ✅ (direct binary approach correct). Ready to merge. |
HongmingWang-Rabbit
pushed a commit
that referenced
this pull request
Jun 12, 2026
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.
Clean replacement for PR #1723. Adds CanCommunicate hierarchy check to terminal HandleConnect endpoint. Guards against cross-workspace terminal access. Approved by Research Lead. Part of KI-005 fix series.