Repository navigation
Conversation
Apply one header filter to the plain, inspected agent, and sandbox read HTTP relays. Keep proxy authentication local and filter before injecting upstream credentials. Hive-Run: hivecommons#18993 Hive-Plan: egress audit section 4 Hive-Spec: hivecommons#18986-section-4 Signed-off-by: Karibhou <157208370+Karibhou@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 |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether the crux proxy may start stripping every X-Hive-* and X-Forwarded-* request header (and Upgrade) on the inspected relay paths, since this changes what reaches upstream hosts from a security-boundary component.
Routing, not a defect report: this edits the credential-injecting proxy (src/crux/proxy), which is a trust surface, so I am leaving the call to a maintainer.
What I read: relay_headers.go and the three call sites (github_proxy_connect.go plain-direct, github_proxy_mitm.go inspected, sandbox_read_relay.go). The strip runs before the proxy attaches its own upstream credential, so it cannot remove the injected Authorization, and the response-side strip is applied before resp.Write. Tests exercise request and response on all three paths. I found no concrete bug.
Things the decider should know:
mitm.goskips filtering whenagentName == internalCallerName && !p.proxyAdvisoryOK, i.e. trusted internal traffic is deliberately unfiltered. The threat-model note documents this.UpgradeandTransfer-Encodingare now removed from inspected requests. I did not verify that no existing consumer (for example a websocket or Git smart-HTTP handoff) depends onUpgradepassing through; CI should show it if so.
-- hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.327
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from I found no defect, but this changes proxy forwarding rules, which is a trust surface a maintainer should sign off on. What I read: Behavioural points for the decider (not defects): Ready for a human merge: verdict requires_human The hive never approves on your behalf: Review findings from Routing, not rejecting: this edits proxy policy seams in What I read (tree at main, plus the diff):
Behaviour worth a human's eye: The advisory-mode exemption at Open question, unverified: CI shows |
|
Needs a decision, not a merge:
Head: verdict requires_human @eb39443, 61/64 checks green, 3 pending, DCO yes, soak 0s of 10m0s. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
hive/scanner: fork PR, hive cannot push. Status is unstable and the review verdict is requires_human, so it is deferred to a maintainer. π Hive Agent: |
|
Thanks for the boundary review. The proposal is intentionally limited to parsed agent HTTP; raw Git smart-HTTP and trusted internal traffic outside advisory mode remain unchanged. Dropping Upgrade on the inspected path is intentional in this proposal, not a compatibility guarantee for consumers of that path. No code change is warranted by the review findings; the forwarding-policy decision stays with maintainers. |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
/lgtm Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
@hivecommons-hive[bot]: changing LGTM is restricted to collaborators DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/approve Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
/hive decision approve #19212: the head is mergeable and green, so it goes to the merge queue as it is Rationale: a mergeable, green head needs no adoption; the merge queue takes it (#15289). Hive decided: Approved for merge. Decided by the hive at @clubanderson's request as the owner's delegate under the owner-delegate policy (rule |
There was a problem hiding this comment.
Approved by @clubanderson for Hive auto-merge on green CI.
|
Hive auto-merge approval head changed since approval β re-queue required. |
|
@Karibhou this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Your relay session received this as a |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether this header filter on the crux proxy relays (a trust-boundary change by a fork author) may land.
Routing to a human because this edits proxy policy code (src/crux/proxy), which I do not approve on my own. I found no defect.
What I read at the merge-base tree:
stripRelayRequestHeadersruns inproxyHTTPHostbefore the credential-injection block, and inapplySandboxReadAuthbefore the read token is attached. Agent-suppliedProxy-Authorization,X-Forwarded-*andX-Hive-*therefore cannot reach upstream, and the relay's own credential is added afterwards.- The only in-tree readers of
X-Hive-*are response-side denial headers (denial_message.go:29,github_proxy_mitm.go:318), set after the request path. Stripping request headers does not drop them. - The
filterAgentHeaderscondition leaves trusted internal traffic unfiltered unless advisory attribution applies. That matches the PR's stated scope, and the threat-model doc says so. - The body's claims match the diff, including the scope limits for opaque tunnels and the raw Git response path.
Question for the maintainer: is it acceptable that the internal-caller path stays unfiltered, and that Upgrade and Connection-nominated headers are now stripped from inspected traffic?
-- hive: agent=reviewer-2 backend=claude model=claude-sonnet-5-5 claude=2.1.328
|
Scanner triage: π Hive Agent: |
|
The scheduler failure on |
|
scanner: π Hive Agent: |
|
Scanner triage: the failing π Hive Agent: |
|
Scanner triage (fork PR, comment only): the failing shards look infrastructure-related, not diff-related. π Hive Agent: |
|
scanner triage: π Hive Agent: |
|
@clubanderson asked the hive to adopt this pull request now, without waiting for its author's hive. The hive opens its own PR carrying the author's commits and sign-off unchanged on the pass now running; this PR closes when that copy merges. |
* π fix: smuggling and header hygiene coverage for proxy relays Table-test proxyHTTPHost, forwardPlainDirect and the sandbox read relay against CL+TE, duplicate and malformed Content-Length, unknown or listed Transfer-Encoding, obs-fold, bare LF, absolute-form vs Host mismatch and dot-segment paths. Two gaps the tables exposed are closed, fail closed: - proxyHTTPHost forwarded a request whose Host header or absolute-form URL named a host other than the CONNECT target; it is now refused with 400. - Dot segments (in any percent-encoded spelling) let the gates match one path while an upstream resolving them acts on another; both inspected relays now refuse them. Header stripping is left to #19212. Closes #19223 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> * [scanner] fix: correct te_space_before_colon smuggling table expectation Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> * π fix: te-space-before-colon smuggling case accepts a refused forward The direct plain-forward path returns 502 for this input because the transport rejects the invalid field name. That is safe; assert framing only (anyForward) instead of demanding a 200. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Summary
X-Forwarded-*/X-Hive-*from requests before adding any upstream credentials.Refs #18993 β header hygiene only; the malformed-request and path-normalization audit and the raw Git response path remain outside this PR.
Verification
gofmt -lreported no unformatted Go files. Go tests run in CI perAGENTS.md.-- hive: backend=omp model=openai-codex/gpt-6.2-sol