Repository navigation
π fix: strip hop-identity headers and table-test proxy relays - #19007
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
Strip Proxy-Authorization, Proxy-Connection, Forwarded, X-Forwarded-* and X-Hive-* from agent requests on forwardPlainDirect, proxyHTTPHost and the sandbox read relay, and table-test all three relays against request smuggling framing. Closes #18993 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: CI pending - sweep will merge when green. π Hive Agent: |
There was a problem hiding this comment.
Decision needed: @clubanderson should confirm that stripping X-Hive-, X-Forwarded-, Forwarded and Proxy-* headers from all agent requests leaving the proxy breaks no legitimate hive-to-hive hop.
Routing to a human because this changes what the egress proxy forwards to origins (trust boundary). I am not approving.
What I checked: stripAgentHopIdentityHeaders in agent_header_hygiene.go matches on canonical names, so lower-case x-hive-role: is removed too. The header-strip table is described as failing without the fix. I did not trace the three call sites or verify the claim that control-plane traffic is left alone, so a maintainer should confirm that exemption.
-- hive: agent=reviewer-2 backend=claude model=claude-sonnet-5-5 claude=2.1.327
Open PR overlap checkβ
Resolved: no conflicting open PRs or same-file overlaps remain against |
|
Re-authoring: the hive's fixer gave up on this PR after 6 attempts on |
The three relays an agent request crosses (the plain-HTTP forward, the MITM relay and the sandbox read relay) forwarded X-Forwarded-, Forwarded and X-Hive- headers exactly as the agent wrote them, and the MITM relay also forwarded Proxy-Authorization. The dashboard trusts X-Hive-User and X-Hive-Role, and origins that honour X-Forwarded-* would record whatever client address or scheme the agent chose, so an agent could speak with the hive's voice or misstate who it is to any host past the proxy. One helper (stripAgentHopIdentityHeaders) now removes them on all three paths, so the paths cannot drift apart. The MITM relay strips only after its gates have run, and leaves the hive's own control-plane traffic alone.
Smuggling: each relay is now table-tested with raw CL.TE, TE.CL, conflicting or signed Content-Length, unknown, duplicated or listed Transfer-Encoding, whitespace before the colon, and obs-fold payloads. A hand-parsing fake origin records the headers byte for byte, so it can see normalisation that net/http would otherwise hide. The tests only require that a relay either refuses a request or forwards it with a single framing, and never passes an ambiguous one on. They pin how the relays behave today, since all of them re-serialise requests. The header-strip table fails without the fix.
Closes #18993
π€ Generated with Claude Code
-- hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.327