-
Notifications
You must be signed in to change notification settings - Fork 840
Identity Zone Selection via X-Zid Header #3427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
@adrianhoelzl-sap How does this impact cookies and security? What If I do a request like this and this sets up my cookies (including authentication stored in the session) Do I just gain access across zones? |
This scenario should be addressed by this check here: uaa/server/src/main/java/org/cloudfoundry/identity/uaa/authentication/SessionResetFilter.java Line 60 in df50723
The zone resolved through the subdomain or |
|
The But all the filters before that, that may contain logic and send redirects prior to the completion of the filter chain are still vulnerable to this. A lot of the SAML/OAuth/OIDC happens in just filters, and not in MVC endpoints, and those filters would be working under incorrect assumptions. Given the risk, is this header really needed? If the HTTP client can set a header, it can set the "Host" header, and if there is a browser involved, cookie handling will be accurate. |
c9a0330 to
b69180d
Compare
strehle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My hope was that we can consolidate the amount of filter (per each request) and optimize but can we integration this logic into one of other IdentityZoneXYZ filters ? ... maybe rename one and do more ?
...rc/main/java/org/cloudfoundry/identity/uaa/oauth/common/util/RandomValueStringGenerator.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/cloudfoundry/identity/uaa/oauth/common/util/RandomValueStringGenerator.java
Outdated
Show resolved
Hide resolved
… session cookie for wrong zone
b69180d to
0d90cfa
Compare
| - excluded-claim1 | ||
| - excluded-claim2 | ||
| login: | ||
| zidHeaderEnabled: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked docs and we have X-Identity-Zone-Id and X-Identity-Zone-Subdomain already , so what is X-zid in comparison ?
The header allows new possiblities, correct ? then we should have thing to tell admin, e.g.
allowZoneSwitchByHeader or allowZoneSwitchByZidHeader
|
|
||
| /** | ||
| * Checks whether there is a mismatch between ... | ||
| * <ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference to X-Identity-Zone-Id, X-Identity-Zone-Subdomain ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the subdomain or the X-Zid header, one selects the identity zone to log in to. With the other two headers, IdZ switching can be performed (only possible if logged in to "uaa" zone).
Example for IdZ switching:
- user has a group
zones.custom.scim.readin the "uaa" zone - log in to "uaa" zone (here, the
X-Zidcan be used as an override), receive token - use the token for performing actions according to the
scim.readscope in the zone with the ID "custom"- In the SCIM requests, he would then need to pass the
X-Identity-Zone-Idheader with the value "custom"
- In the SCIM requests, he would then need to pass the
| void subdomainSetToZone1_ZidHeaderSetToZone2_BothZonesExist_ShouldReturnZone2() throws Exception { | ||
| mockMvc.perform( | ||
| get("/login") | ||
| .header("Host", zone1Subdomain + "." + HOST_NO_SUBDOMAIN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means, even if we have a subdomain but if there is a X-Zid we overrule the subdomain ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the X-Zid header overrides the zone specified by the subdomain.
No description provided.