-
-
Notifications
You must be signed in to change notification settings - Fork 678
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
V50.2.4 (v4.0.3-3.4.4) - cookie __Host- name prefix #2422
Comments
Alternative "stronger" wording:
Optional sentence at the end of the requirement:
If we don't include this extra sentence, we should probably have a requirement which says "user either __Host- or __-Secure-". |
I don't agree with that. Those prefixes are different things and address different problems
|
Yes, I agree they serve different purpose. If you want to be strict about the goal of each requirement you should have the following requirements:
In both cases, this is about protecting from other origins (roughly) overwriting/setting the cookie in our stead. Then maybe "__Secure-" is not that useful if HSTS is used … |
What about the first (main) part? (Verify that the cookie has the "__Host-" prefix for the cookie name unless it is (explicitly) designed to be shared with other hosts.) |
It prevents an adversary from setting the cookie from |
it can be still a problem when HSTS is not set to the main domain. Then any site from the eTLD+1 scope can write a cookie with the same name to the main domain which makes the cookie valid for everything in the same-site scope. Including when someone serves But it is not the topic for |
For me both "__Host-" and "__Secure-" prefixes are about making sure that adversaries do not define/overwrite the cookie for us and should be together in 50.2.4. On the other hand, 50.2.1 would be about making sure that the data stored in the cookie is not exfiltrated. The "__Secure-" prefix does not help with that (the Secure attribute alone does). But I can live with "__Secure-" being discussed in 50.1.2 😄 |
They are not the same.
If there is further need to explain those, I'll invite you to my training ;) |
Note that "__Host-" prevents binding the cookie to a subpath. Some people might want to support cookies bound to paths:
I don't think there are good reasons for not using
To be clear, I still think this should be required but I am raising this point here for reference (and to let the opportunity to express a different opinion). |
Yes, For that reason, those Keycloak cookies are manipulatable from any site from the same-site scope. And for that reason I proposed:
|
It is no longer possible to overwrite an existing secure cookie.
I agree. I think it makes sense to put both prefixes in one requirement. __Host has the behavior of __Secure and more, and it is not possible to include both prefixes. So all cookies should have either the __Secure or __Host prefix. |
Re-checked, that's correct. But you can still write a cookie with the same name to valid for the same request. That is the reason to use
The only duplicating behavior is that you can not write a cookie with the same name from |
I think this makes sense to me Grammar: |
Current requirement, moved from V3.4.4 to V50.2.4 via #2410:
As the requirement is now a general cookie security requirement, the wording must be non-session-cookie specific.
Proposal:
updated proposal from #2422 (comment)
level: from easy to implement point of view, level 1. can be level 2
The text was updated successfully, but these errors were encountered: