Skip to content

Cookie layering - Http prefix #3110

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yoavweiss
Copy link
Contributor

@yoavweiss yoavweiss commented Jun 16, 2025

@yoavweiss yoavweiss requested review from johannhof and annevk June 16, 2025 15:59
@yoavweiss
Copy link
Contributor Author

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?

@reschke reschke added the cookies Issues with the layered-cookies draft. label Jun 17, 2025
@annevk
Copy link

annevk commented Jun 18, 2025

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.

@yoavweiss
Copy link
Contributor Author

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:

  1. Add an HttpOnly (or Http) prefix
  2. Figure out a way to combine multiple prefixes

If that makes sense, I'm happy to turn this into (1) and open an issue to further discuss (2)

Copy link

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@annevk
Copy link

annevk commented Jun 18, 2025

I like the idea of the prefix being just Http for brevity's sake. I also think we should have an issue for the multiple discussion as it'll come back.

@yoavweiss yoavweiss changed the title Cookie layering - HttpOnly and HostHttpOnly prefixes Cookie layering - HttpOnly prefix Jun 18, 2025
@yoavweiss yoavweiss changed the title Cookie layering - HttpOnly prefix Cookie layering - Http prefix Jun 18, 2025
@yoavweiss
Copy link
Contributor Author

I like the idea of the prefix being just Http for brevity's sake. I also think we should have an issue for the multiple discussion as it'll come back.

Revamped this PR to just handle the Http prefix, and opened #3111 for further discussion on prefix combinatorics.

@annevk
Copy link

annevk commented Jun 18, 2025

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.

@yoavweiss
Copy link
Contributor Author

@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.

@yoavweiss yoavweiss requested a review from annevk June 20, 2025 06:58
Copy link

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@yoavweiss yoavweiss requested a review from annevk June 20, 2025 08:44
aarongable pushed a commit to chromium/chromium that referenced this pull request Jun 25, 2025
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 <[email protected]>
Reviewed-by: Chris Fredrickson <[email protected]>
Commit-Queue: Yoav Weiss (@Shopify) <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1478348}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 25, 2025
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 <[email protected]>
Reviewed-by: Chris Fredrickson <[email protected]>
Commit-Queue: Yoav Weiss (@Shopify) <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1478348}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 25, 2025
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 <[email protected]>
Reviewed-by: Chris Fredrickson <[email protected]>
Commit-Queue: Yoav Weiss (@Shopify) <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1478348}
Remove the HostHttpOnly parts and review comments

Remove some more hosthttponly

rename

Add back HostHttp and split out conditions

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Move algos to misc

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Mike Taylor <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Mike Taylor <[email protected]>

know

Add a path-attribute

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Revert incorrect default path changes

has path attribute

Cookie layering - HttpOnly and HostHttpOnly prefixes

Remove the HostHttpOnly parts and review comments

Remove some more hosthttponly

rename

Add back HostHttp and split out conditions

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Move algos to misc

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Mike Taylor <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Mike Taylor <[email protected]>

know

Add a path-attribute

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Update draft-ietf-httpbis-layered-cookies.md

Co-authored-by: Anne van Kesteren <[email protected]>

Revert incorrect default path changes

has path attribute
aarongable pushed a commit to chromium/chromium that referenced this pull request Jun 25, 2025
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) <[email protected]>
Reviewed-by: Maks Orlovich <[email protected]>
Reviewed-by: Chris Fredrickson <[email protected]>
Reviewed-by: Dylan Cutler <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1478697}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 25, 2025
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) <[email protected]>
Reviewed-by: Maks Orlovich <[email protected]>
Reviewed-by: Chris Fredrickson <[email protected]>
Reviewed-by: Dylan Cutler <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1478697}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 25, 2025
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) <[email protected]>
Reviewed-by: Maks Orlovich <[email protected]>
Reviewed-by: Chris Fredrickson <[email protected]>
Reviewed-by: Dylan Cutler <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1478697}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cookies Issues with the layered-cookies draft.
Development

Successfully merging this pull request may close these issues.

4 participants