Repository navigation
security(gateway): refuse the standard spoofable client-IP and host headers - #870
Merged
Merged
Conversation
The matcher listed 4 of ~29 standard client-IP and host headers, and groupLocation built a URL from the request Host, bypassing --url.
lakhansamani
force-pushed
the
security/spoofable-header-override
branch
from
November 8, 2026 13:50
4db8502 to
d8c5344
Compare
Merged
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.
groupLocationbuilt an absolute URL from the requestHost, which bypassed--url. grpc-gateway v2.33.0 already drops everyGrpc-Metadata-*header, so the matcher change is a guard against that behaviour coming back; thegroupLocationchange closes a gap that is open now.internal/gateway/mount.go: the refusal list moves intorefusedForwardingHeaders, a package-level set of 29 canonical header keys. The matcher and its test both read that set, so the list cannot drift away from the policy. Add a key there, not at the call site.internal/http_handlers/scim/groups.go:groupLocationtakes its base fromparsers.GetHostFromRequest, so--urlwins over every header. A SCIM client could previously choose the host in themeta.locationit got back. Risk to check: on a deployment that sets no--url,meta.locationnow always carries a value, where it was omitted whenHostwas empty.X-Forwarded-ForandX-Forwarded-Hostkeep their bare spelling.runtime.AnnotateContextwrites both itself, before this matcher runs, so no header policy here can refuse them. Their consumers hold the other half:transport.clientIPFromGRPCreads the rightmostx-forwarded-forvalue, andtransport.hostURLFromGRPCprefers--urland readsx-authorizer-url.*http.Request, so the gin path still readsX-Forwarded-ForandX-Real-Ipunder--trusted-proxies. Nothing in this repo reads the vendor keys (Cf-Connecting-Ip,True-Client-Ipand the rest) today, and gin'sTrustedPlatformis unset, so those entries prevent a future regression rather than fix a present one.