test(gateway): pin plugin auth:gateway gutted-posture tripwire (#2724)#2726
Merged
Merged
Conversation
The plugin-route gateway-auth perimeter is deliberately gutted (always-pass) in the fork. An auth:"gateway" route stays unreachable only because buildPluginRequestStages forwards gatewayAuthSatisfied=true WITHOUT operator scopes, so the second guard in createGatewayPluginRequestHandler still blocks dispatch. That safety is emergent from two half-disabled mechanisms — a sync re-coupling scope propagation would silently re-open it (security-architect flag during #2720). The guard's unit tests cover it in isolation; this adds a black-box integration test pinning the server-pipeline wiring (gut -> guard) end-to-end, plus a positive companion proving the path stays live (so the negative assertion cannot pass vacuously). Verified non-vacuous: the tripwire fails by design when scope propagation is re-coupled at server-http.ts:353. Runs in the gateway suite enabled by #2720, so it gates every PR. DIFF-SYNC re-introduction guard (hq-internal ADR 0010/0011 family). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
alexey-pelykh
enabled auto-merge (squash)
June 17, 2026 14:53
This was referenced Jun 17, 2026
Closed
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
Adds a behavioral gutted-posture tripwire for the plugin-route gateway-auth perimeter — a new test file (
src/gateway/server.plugin-gateway-auth-tripwire.test.ts, 2 tests). No production changes.Why
RemoteClaw deliberately guts the plugin-route gateway-auth perimeter:
buildPluginRequestStagesinserver-http.tshardcodesgatewayAuthSatisfied = true("always pass") instead of calling the removedenforcePluginRouteGatewayAuth.That gut is not a clean unauth bypass on its own. An
auth: "gateway"plugin route stays unreachable only because a second, independent guard increateGatewayPluginRequestHandlerrefuses to dispatch whengatewayRequestOperatorScopesisundefined— andbuildPluginRequestStagesforwardsgatewayAuthSatisfiedbut never the operator scopes.The safety is therefore emergent from two half-disabled mechanisms. A future upstream sync that re-couples scope propagation while leaving
gatewayAuthSatisfied = truewould silently re-open the perimeter. The existing unit tests inserver/plugins-http.test.tsexercise that guard in isolation (they pass the dispatch context directly), so they cannot catch a regression in the server-pipeline wiring that feeds it.How
auth: "gateway"route through the real server pipeline and asserts it stays blocked, anchoring on the guard'sblocked without caller scope contextlog to prove the block happens at the scope guard (not a perimeter 401, not guard 1). Verified non-vacuous: it fails by design when scope propagation is re-coupled atserver-http.ts:353.The test runs in the gateway behavioral suite enabled in #2720, so it gates every PR. It is documented in-file as a DIFF-SYNC re-introduction guard: if it fails after an upstream sync, restore the gutted-posture — do not weaken the test.
One item from #2724.
🤖 Generated with Claude Code