Skip to content

πŸ› fix: strip hop-identity headers and table-test proxy relays - #19007

Closed
hivecommons-hive[bot] wants to merge 1 commit into
v5from
scanner/fix-18993
Closed

hivecommons-hive[bot] wants to merge 1 commit into
v5from
scanner/fix-18993

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 18, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 18, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

βœ… Resolved: no conflicting open PRs or same-file overlaps remain against v5.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Re-authoring: the hive's fixer gave up on this PR after 6 attempts on 564999bc1fa2. Closing it as superseded; the hive opens a fresh PR for #18993 from the current v5 on its next cycle. Nothing from this branch is merged.

@hivecommons-hive hivecommons-hive Bot added the hive/superseded Closed by Hive: a different merged PR already landed this change label Nov 19, 2026
@hivecommons-hive hivecommons-hive Bot closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. hive/superseded Closed by Hive: a different merged PR already landed this change role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/L Denotes a PR that changes 100-499 lines, ignoring generated files. stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] audit(egress): request smuggling and header hygiene table tests for the proxy relays

0 participants