fix: strip subdomain header on UAA-zone switch to prevent invitation … - #3990
Merged
Conversation
…provider-policy bypass ## Summary - IdentityZoneSwitchingFilter was only stripping X-Identity-Zone-Id when a request resolved to the UAA (system) zone, leaving X-Identity-Zone-Subdomain on the forwarded request. - InvitationsEndpoint skips client lookup when either zone header is present, so the leftover subdomain header caused client to remain null. - DomainFilter only applies allowed_providers restrictions when a client was loaded — with client == null the per-client identity-provider policy was silently bypassed. - A caller with only scim.invite could send X-Identity-Zone-Id: uaa plus any X-Identity-Zone-Subdomain value to invite users via identity providers the OAuth client was explicitly prohibited from using.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens identity-zone switching by ensuring both zone headers are stripped when a request “switches” to the UAA (system) zone, preventing downstream endpoints from interpreting leftover zone headers in a way that bypasses per-client invitation provider restrictions.
Changes:
- Strip
X-Identity-Zone-Subdomainin addition toX-Identity-Zone-Idwhen the resolved zone is the UAA zone. - Add a regression test asserting both headers are removed in the UAA-zone “superfluous switch” path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
server/src/main/java/org/cloudfoundry/identity/uaa/zone/IdentityZoneSwitchingFilter.java |
Extends the header-stripping wrapper to remove both zone headers when the resolved zone is UAA. |
server/src/test/java/org/cloudfoundry/identity/uaa/zone/IdentityZoneSwitchingFilterTests.java |
Adds a test verifying both headers are removed when switching to the UAA zone. |
duanemay
approved these changes
Jul 23, 2026
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.
fix: strip subdomain header on UAA-zone switch to prevent invitation provider-policy bypass
Summary