Cookie layering - Http prefix - #3110
Conversation
|
Given https://lists.w3.org/Archives/Public/ietf-http-wg/2025AprJun/0188.html, maybe we want to land __HttpOnly first while we figure out what the compounding mechanism here should be? |
|
It might be good to open an issue to discuss further, but my inclination would be that we turn this into some kind of table of prefix strings and their corresponding restrictions down the line. I don't think the combinatorial explosion is all that bad and allowing them in arbitrary order would in fact turn a simple prefix match into a parser question with all the resulting issues that come with that. |
|
Yeah, there's a discussion happening on that front in https://lists.w3.org/Archives/Public/ietf-http-wg/2025AprJun/0192.html I think we can split this into two separate things:
If that makes sense, I'm happy to turn this into (1) and open an issue to further discuss (2) |
annevk
left a comment
There was a problem hiding this comment.
Unfortunately this will also need a corresponding PR to the Cookie Store API. Perhaps if we eventually abstract this convention somehow we can improve that.
|
I like the idea of the prefix being just |
Revamped this PR to just handle the |
|
I added a checklist to OP for what remains to be done. I suppose we also need to make some assessment as to whether this has broad enough support, but I think it has from the list discussion. |
|
@annevk - I tried to split out the conditions to separate algorithms, to make it easier/clearer when combining them for HostHttp. Let me know what you think. |
annevk
left a comment
There was a problem hiding this comment.
I like it. I'm half-tempted to also suggest introducing a list of known prefixes so we can deduplicate some of that across specifications, but I think this is sufficient for now. At some point the abstractions might also impede clarity.
This CL implements the __Http- [1] cookie prefixes. They enable site operators to know that a certain cookie was issued with the HttpOnly attribute, and was not set by a malicious script on the client side. [1] httpwg/http-extensions#3110 Bug: 426096760 Change-Id: I13205747406a8b3c33bd9f0e60abd7526eb9490d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6638647 Reviewed-by: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Chris Fredrickson <cfredric@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Cr-Commit-Position: refs/heads/main@{#1478348}
This CL implements the __Http- [1] cookie prefixes. They enable site operators to know that a certain cookie was issued with the HttpOnly attribute, and was not set by a malicious script on the client side. [1] httpwg/http-extensions#3110 Bug: 426096760 Change-Id: I13205747406a8b3c33bd9f0e60abd7526eb9490d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6638647 Reviewed-by: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Chris Fredrickson <cfredric@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Cr-Commit-Position: refs/heads/main@{#1478348}
This CL implements the __Http- [1] cookie prefixes. They enable site operators to know that a certain cookie was issued with the HttpOnly attribute, and was not set by a malicious script on the client side. [1] httpwg/http-extensions#3110 Bug: 426096760 Change-Id: I13205747406a8b3c33bd9f0e60abd7526eb9490d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6638647 Reviewed-by: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Chris Fredrickson <cfredric@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Cr-Commit-Position: refs/heads/main@{#1478348}
c17fffa to
e99314a
Compare
Similar to [1], this adds an __HostHttp- prefix that ensures that a cookies is both Host-scoped and httpOnly. Specified in [2] [1] https://chromium-review.googlesource.com/c/chromium/src/+/6638647 [2] httpwg/http-extensions#3110 Bug: 426096760 Change-Id: Id1637331eaa3035443d005450c022b326378aeed Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6650996 Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Reviewed-by: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Chris Fredrickson <cfredric@chromium.org> Reviewed-by: Dylan Cutler <dylancutler@google.com> Cr-Commit-Position: refs/heads/main@{#1478697}
Similar to [1], this adds an __HostHttp- prefix that ensures that a cookies is both Host-scoped and httpOnly. Specified in [2] [1] https://chromium-review.googlesource.com/c/chromium/src/+/6638647 [2] httpwg/http-extensions#3110 Bug: 426096760 Change-Id: Id1637331eaa3035443d005450c022b326378aeed Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6650996 Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Reviewed-by: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Chris Fredrickson <cfredric@chromium.org> Reviewed-by: Dylan Cutler <dylancutler@google.com> Cr-Commit-Position: refs/heads/main@{#1478697}
Similar to [1], this adds an __HostHttp- prefix that ensures that a cookies is both Host-scoped and httpOnly. Specified in [2] [1] https://chromium-review.googlesource.com/c/chromium/src/+/6638647 [2] httpwg/http-extensions#3110 Bug: 426096760 Change-Id: Id1637331eaa3035443d005450c022b326378aeed Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6650996 Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Reviewed-by: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Chris Fredrickson <cfredric@chromium.org> Reviewed-by: Dylan Cutler <dylancutler@google.com> Cr-Commit-Position: refs/heads/main@{#1478697}
As discussed at IETF 122: https://httpwg.org/wg-materials/ietf122/minutes.html#delete-cookie-and-_httponly-prefix Also fixes httpwg#3112 and several editorial issues. Co-authored-by: Mike Taylor <miketaylr@google.com> Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
As the relevant PR [1] has landed, and the I2S [2] approved, this is now ready to be enabled by default. [1] httpwg/http-extensions#3110 [2] https://groups.google.com/a/chromium.org/g/blink-dev/c/WsXlDO6oO2E Bug: 426096760 Change-Id: I8195cab85387354f8773eedb4cb75ac13d2645cf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6683341 Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Reviewed-by: Adam Rice <ricea@chromium.org> Cr-Commit-Position: refs/heads/main@{#1480468}
Automatic update from web-platform-tests __Http- cookie prefix This CL implements the __Http- [1] cookie prefixes. They enable site operators to know that a certain cookie was issued with the HttpOnly attribute, and was not set by a malicious script on the client side. [1] httpwg/http-extensions#3110 Bug: 426096760 Change-Id: I13205747406a8b3c33bd9f0e60abd7526eb9490d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6638647 Reviewed-by: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Chris Fredrickson <cfredric@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Cr-Commit-Position: refs/heads/main@{#1478348} -- wpt-commits: b42bb20b09d901cd28d8f9b2f0468998b88bcd98 wpt-pr: 53381
Automatic update from web-platform-tests __HostHttp- cookie prefix Similar to [1], this adds an __HostHttp- prefix that ensures that a cookies is both Host-scoped and httpOnly. Specified in [2] [1] https://chromium-review.googlesource.com/c/chromium/src/+/6638647 [2] httpwg/http-extensions#3110 Bug: 426096760 Change-Id: Id1637331eaa3035443d005450c022b326378aeed Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6650996 Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Reviewed-by: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Chris Fredrickson <cfredric@chromium.org> Reviewed-by: Dylan Cutler <dylancutler@google.com> Cr-Commit-Position: refs/heads/main@{#1478697} -- wpt-commits: 3b3a5212b8fb4b3ea054b5150c74de66713cbe65 wpt-pr: 53394
Automatic update from web-platform-tests __Http- cookie prefix This CL implements the __Http- [1] cookie prefixes. They enable site operators to know that a certain cookie was issued with the HttpOnly attribute, and was not set by a malicious script on the client side. [1] httpwg/http-extensions#3110 Bug: 426096760 Change-Id: I13205747406a8b3c33bd9f0e60abd7526eb9490d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6638647 Reviewed-by: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Chris Fredrickson <cfredric@chromium.org> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Cr-Commit-Position: refs/heads/main@{#1478348} -- wpt-commits: b42bb20b09d901cd28d8f9b2f0468998b88bcd98 wpt-pr: 53381
Automatic update from web-platform-tests __HostHttp- cookie prefix Similar to [1], this adds an __HostHttp- prefix that ensures that a cookies is both Host-scoped and httpOnly. Specified in [2] [1] https://chromium-review.googlesource.com/c/chromium/src/+/6638647 [2] httpwg/http-extensions#3110 Bug: 426096760 Change-Id: Id1637331eaa3035443d005450c022b326378aeed Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6650996 Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Reviewed-by: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Chris Fredrickson <cfredric@chromium.org> Reviewed-by: Dylan Cutler <dylancutler@google.com> Cr-Commit-Position: refs/heads/main@{#1478697} -- wpt-commits: 3b3a5212b8fb4b3ea054b5150c74de66713cbe65 wpt-pr: 53394
As discussed at IETF 122, this is a stab at integrating https://yoavweiss.github.io/httponly_prefix/draft-httponlyprefix-weiss-http.html with the Cookie layering processing model.