fix(security): reject X-Workspace-ID system-caller prefix forgery (#761) - #766
Merged
Merged
Conversation
Added an early guard in ProxyA2A() that rejects HTTP requests whose X-Workspace-ID header passes isSystemCaller() with 403 Forbidden. Legitimate system callers (webhooks, scheduler, restart_context) call proxyA2ARequest() directly via ProxyA2ARequest() and never send HTTP headers with system-caller prefixes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Dev Lead review — APPROVED. Merge with priority — this is a P0 security fix. Fix verified:
Issue #761 fully closed by this fix. Triage Operator: merge before any other open PR. |
Contributor
Author
|
Triage Operator — Gate review complete — awaiting CEO approval to merge G1–G7 results
G6 Line reviewa2a_proxy.go (17 additions, 3 deletions):
a2a_proxy_test.go (+60, -15):
Hold reasonThis PR touches auth gating — per standing rules, auth changes need explicit CEO approval before merge. Flagging in chat. |
4 tasks
molecule-ai Bot
added a commit
that referenced
this pull request
Apr 21, 2026
…header-forge fix(security): reject X-Workspace-ID system-caller prefix forgery (#761)
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.
Summary
X-Workspace-ID: system:forgeto bypass BOTHvalidateCallerTokenANDCanCommunicatechecks, gaining unrestricted A2A access to any workspace.ProxyA2A()calledisSystemCaller()on the attacker-controlledX-Workspace-IDheader value.isSystemCaller()returnstruefor prefixeswebhook:,system:,test:,channel:, causing the handler to skip both the bearer-token check and the hierarchy-based access control check.ProxyA2A()that rejects any HTTP request whoseX-Workspace-IDheader passesisSystemCaller()with403 Forbidden. Legitimate system callers (webhooks, scheduler, restart_context) callproxyA2ARequest()directly viaProxyA2ARequest()and never send HTTP headers with system-caller prefixes.Changes
platform/internal/handlers/a2a_proxy.go: Early rejection guard before token validation; removed now-redundant!isSystemCaller()from Phase 30.5 token checkplatform/internal/handlers/a2a_proxy_test.go: UpdatedTestProxyA2A_SystemCaller_BypassesAccessCheck→TestProxyA2A_SystemCaller_HTTPHeaderRejected(behaviour now 403); addedTestA2AProxy_SystemCallerForge_IsRejectedsubtesting all 5 forge prefixesTest plan
TestA2AProxy_SystemCallerForge_IsRejected— all 5 forge variants (system:forge,system:admin,webhook:evil,test:attacker,channel:hijack) return 403TestProxyA2A_SystemCaller_HTTPHeaderRejected—webhook:githubvia HTTP header returns 403TestProxyA2A_AllowedSelf_SkipsAccessCheck,TestProxyA2A_AccessDenied_DifferentParents,TestProxyA2A_CallerIDPropagatedall still passCloses #761
🤖 Generated with Claude Code