Skip to content
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

Using HOST- prefix as a requirement seems like a bad idea / might not be possible to do #30

Closed
LGraber opened this issue Dec 8, 2021 · 19 comments

Comments

@LGraber
Copy link

LGraber commented Dec 8, 2021

Third-parties that embed content do not always control all of the cookies that appear to be associated with their domain. Specifically there are a number of intermediate systems that can exist between the third party and embedding page such as a load balancers (here are some docs on AWS ELB). Some of these intermediate systems allow a level of control over these cookies. Obviously many have enhanced that with the advent of SameSite=None requirement for embedded cookies. However, many may not allow the name to be changed. It seems like an unnecessary requirement to have the cookie be named a specific way instead of simply requiring those attributes to be set. I honestly don't know the origin of these convenience naming schemes and so can't figure out why using them as a requirement is a good thing. Can we please drop this naming requirement and just require the attributes be set (either explicitly or via the naming option). It will avoid a lot of headaches

Additionally, for better or worse, our software does not currently require https (I would love it to). We support both hosted and self-managed installations. For our customers who self-manage their servers, we highly recommend configuring https but don't require it (it is required if you want to do embedding). While it is one thing for us to change whether we set an attribute of a cookie when we create it (we already do that for SameSite=None to support embedding), it is another for us to conditionally change the name of our cookies. You could hypothesize I wonderfully clean codebase where all cookies are only ever created / read in one place, but that is rarely the case. Also, even in our code, there are cookies we might not be able to change the name of such as JSESSIONID if you are using certain Spring libraries. Again, removing the naming requirement will avoid a lot of potential blocking issues

@annevk
Copy link

annevk commented Dec 8, 2021

The naming scheme is part of the Cookies RFC: https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-4.1.3.2. It ensures the cookie cannot be spoofed by another subdomain of the registrable domain.

@LGraber
Copy link
Author

LGraber commented Dec 9, 2021

Thanks! That is good to know! Still causes the problems I describe above which makes using this naming scheme potentially not doable

@LGraber
Copy link
Author

LGraber commented Feb 7, 2022

Is this requirement going to be removed? This could be an adoption blocker and this feature, CHIPS, is needed for 3PC deprecation to not cause lots of issues. Thoughts?

@DCtheTall
Copy link
Collaborator

DCtheTall commented Feb 8, 2022

Hey @LGraber, thanks for bringing up these concerns!

Third-parties that embed content do not always control all of the cookies that appear to be associated with their domain.

Interesting, that is good to know!

It seems like an unnecessary requirement to have the cookie be named a specific way instead of simply requiring those attributes to be set.

We are considering changing the Partitioned attribute requirements to no longer require the __Host- prefix in the cookie's name, but we'd definitely want to keep the attribute-level requirements of the __Host- prefix (Secure and Path=/ are required, the Domain would be disallowed), especially requiring the Secure attribute.

It's important to note that the __Host- prefix fixes a pretty egregious security hole in cookies where a server cannot tell if a cookie was set by a subdomain or an insecure endpoint. Having CHIPS require the __Host- was originally intended to be a way to facilitate more widespread adoption of using the prefix, thus reducing the impact of the problem the with cookies' original security model.

That being said, we understand that sometimes compromises need to be made to make CHIPS compatible with the current ecosystem. We will still require the __Host- prefix in the Chrome Origin Trial for CHIPS in M100, but we will consider removing it when CHIPS is shipped in Chrome.

@LGraber
Copy link
Author

LGraber commented Mar 22, 2022

@DCtheTall Hi Dylan ... thanks for the response. How, though, can I test this without removing this requirement. Can you please :) provide an earlier release which has this removed. It seems ... inappropriate to wait until shipping when this design choice is blocking the usability of the feature. Not sure exactly when CHIPS is releasing now but I / we need this and need to be able to test it before any privacy sandbox restrictions are enabled.

As for the Secure and Path=/ and no Domain, I am fine with those. I understand the underlying requirements and needs. It is just encapsulating this in a "name" that is problematic

@DCtheTall
Copy link
Collaborator

As for the Secure and Path=/ and no Domain, I am fine with those. I understand the underlying requirements and needs. It is just encapsulating this in a "name" that is problematic

Totally grok your concern there. Filed https://crbug.com/1309902 to track this issue. I also started https://crrev.com/c/3549936. I'll keep you updated on which Chrome release you can expect the name requirement to be changed for the OT.

@annevk
Copy link

annevk commented Mar 24, 2022

That does seem like a pretty big regression over the initial proposal as origin-scoped would no longer be feasible.

Or perhaps the required lack of a Domain attribute gives the same guarantees?

@krgovind
Copy link
Collaborator

Or perhaps the required lack of a Domain attribute gives the same guarantees?

@annevk - Correct, we still plan to enforce the lack of a Domain attribute.

@annevk
Copy link

annevk commented Mar 25, 2022

And that gives the same guarantees? (I think it does, but it would be good if someone confirmed it.)

@DCtheTall
Copy link
Collaborator

DCtheTall commented Mar 25, 2022

And that gives the same guarantees?

In terms of how the browser treats the cookie, no, there is no difference.

However, from the server-side perspective, cookies set with the __Host- prefix guarantee the server that the cookie was not set by a compromised, insecure endpoint or compromised subdomain. That is why the prefix is encoded into the name, to give the server some signal their cookie is safer than a cookie set without it.

For partitioned cookies, this may be a bit less of a concern. The __Host- prefix was invented in a world where SameSite=None cookie are globally available to the cookie's site regardless of which context the request is coming from. With partitioned cookies, the compromised endpoint would need to be on the same top-level site as the attacker intends to use the cookie on. That being said, the security win servers get from seeing __Host- in the prefix still apply to partitioned cookies nonetheless.

@annevk
Copy link

annevk commented Mar 26, 2022

Well, how can it be set from a subdomain if the Domain attribute is forbidden? I'm not sure I see the compromised endpoint argument, why could those not set any cookie?

@DCtheTall
Copy link
Collaborator

Well, how can it be set from a subdomain if the Domain attribute is forbidden?

Consider if some site, example.com, wants to set a cookie on good.example.com and decides to not use the __Host- prefix:

Set-Cookie: foo=bar; Path=/; Secure; Max-Age=...

The browser would send the following header in subsequent requests:

Cookie: foo=bar

Now let's say a compromised subdomain of that site, evil.example.com, overwrites the cookie foo using a Domain cookie:

Set-Cookie: foo=something_evil; Path=/; Domain=example.com; Max-Age=...

After the user returns to good.example.com, the cookie header will be

Cookie: foo=something_evil

and example.com cannot tell whether the cookie was set by the malicious subdomain.

The idea behind including the __Host- prefix in the cookie's name is that it gives example.com signal that the cookie was actually set by the subdomain that the request is for. Since it should not be possible for evil.example.com to set a cookie with the __Host- prefix that gets sent to requests to good.example.com.

aarongable pushed a commit to chromium/chromium that referenced this issue Mar 28, 2022
Some sites that wish to use partitioned cookies may not have control
over their cookies' names for various reasons (see
privacycg/CHIPS#30).

To account for this for part of the CHIPS OT running from M100 to M102,
we will remove the name requirement only.

In other words, we still require the cookies have Secure, Path=/, and
no Domain. We just remove the requirement that the name is prefixed
with "__Host-".

Bug: 1225444,1309902
Change-Id: Id9ccfe89848a90cf97eb77463fc0fbbb75411cc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3549936
Reviewed-by: Maks Orlovich <[email protected]>
Reviewed-by: Steven Bingler <[email protected]>
Commit-Queue: Dylan Cutler <[email protected]>
Cr-Commit-Position: refs/heads/main@{#986211}
@DCtheTall
Copy link
Collaborator

@LGraber this change will be part of Chrome 101's release. We are still TBD if we will reinstate the name requirement at the end of the OT, but from 101-102 you can test CHIPS without the prefix.

@annevk
Copy link

annevk commented Apr 4, 2022

@DCtheTall I understand that attack, but the question is how it can work in the context of partitioned cookies, right? Given that the Domain attribute is forbidden, it seems like it can't. So the name restriction looks redundant in the specific case of partitioned cookies.

@DCtheTall
Copy link
Collaborator

I understand that attack, but the question is how it can work in the context of partitioned cookies, right? Given that the Domain attribute is forbidden

For partitioned cookies, this is definitely less of a concern, I think we are in agreement there.

Our thinking for requiring the prefix was that since not all clients support partitioned cookies yet, and older versions of some clients never will, we figured requiring the __Host- prefix would increase adoptions of better cookie security practices across the web (though that relies on the assumption that servers would use the same cookie for both types of clients). This is discussed a little in the explainer's Alternate Designs section.

@LGraber
Copy link
Author

LGraber commented Apr 20, 2022

Sorry for the delayed thank you but THANK YOU. This removal of the naming change makes the requirement much more inline with the previous changes to add the SameSite=None attribute and so a more 'known' quantity. I appreciate you hearing the feedback, looking through the implications, and making the change to help support easier transitions. Thanks! @DCtheTall @annevk @krgovind

@LGraber
Copy link
Author

LGraber commented Apr 20, 2022

Last question ... when does 101 ship? We are going to put in our changes without the name change as that is not really manageable. I want to know when we can turn this on to try it? Thanks! Have you rethought keeping this trial running after this change? We need this change to do full testing and get you better feedback. Thanks! @DCtheTall

@krgovind
Copy link
Collaborator

Last question ... when does 101 ship? We are going to put in our changes without the name change as that is not really manageable. I want to know when we can turn this on to try it? Thanks! Have you rethought keeping this trial running after this change? We need this change to do full testing and get you better feedback. Thanks! @DCtheTall

@LGraber - You can see the planned Chrome "Stable Release" dates here. 101 releases on April 26. We do intend plan to run the trial at least through the end of 102. Please see this blogpost for instructions on participating in the trial. Looking forward to your feedback!

pkviet pushed a commit to pkviet/chromium that referenced this issue Jun 4, 2022
Remove __Host- prefix requirement from Partitioned cookies

Some sites that wish to use partitioned cookies may not have control
over their cookies' names for various reasons (see
privacycg/CHIPS#30).

To account for this for part of the CHIPS OT running from M100 to M102,
we will remove the name requirement only.

In other words, we still require the cookies have Secure, Path=/, and
no Domain. We just remove the requirement that the name is prefixed
with "__Host-".

(cherry picked from commit 30654c2)

Bug: 1225444,1309902
Change-Id: Id9ccfe89848a90cf97eb77463fc0fbbb75411cc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3549936
Reviewed-by: Maks Orlovich <[email protected]>
Reviewed-by: Steven Bingler <[email protected]>
Commit-Queue: Dylan Cutler <[email protected]>
Cr-Original-Commit-Position: refs/heads/main@{#986211}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3557534
Cr-Commit-Position: refs/branch-heads/4951@{chromium#266}
Cr-Branched-From: 27de622-refs/heads/main@{#982481}
@DCtheTall
Copy link
Collaborator

Closing this now that the __Host- prefix is no longer a part of this proposal.

mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
Some sites that wish to use partitioned cookies may not have control
over their cookies' names for various reasons (see
privacycg/CHIPS#30).

To account for this for part of the CHIPS OT running from M100 to M102,
we will remove the name requirement only.

In other words, we still require the cookies have Secure, Path=/, and
no Domain. We just remove the requirement that the name is prefixed
with "__Host-".

Bug: 1225444,1309902
Change-Id: Id9ccfe89848a90cf97eb77463fc0fbbb75411cc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3549936
Reviewed-by: Maks Orlovich <[email protected]>
Reviewed-by: Steven Bingler <[email protected]>
Commit-Queue: Dylan Cutler <[email protected]>
Cr-Commit-Position: refs/heads/main@{#986211}
NOKEYCHECK=True
GitOrigin-RevId: 30654c2ba042baa9b8ce218e1ec7a8ae00d1d365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants