Identity Zone Selection via X-Zid Header#3427
Identity Zone Selection via X-Zid Header#3427adrianhoelzl-sap wants to merge 16 commits intodevelopfrom
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: 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.
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.
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.
What is the difference to X-Identity-Zone-Id, X-Identity-Zone-Subdomain ?
There was a problem hiding this comment.
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.
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.
Yes, the X-Zid header overrides the zone specified by the subdomain.
No description provided.