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

Add WPT tests for SameSite cookies in ServiceWorkers with nested frames. #31690

Merged
merged 1 commit into from
Nov 23, 2021

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Nov 19, 2021

This CL adds a number of new cases to the service worker SameSite
cookies test. The cases break down into two general types:

  1. Cases where A1 frames B frames A2, and then A2 calls window.open()
    to an A origin URL.
  2. Cases where A1 frames B frames A2, and then A2 sets the location
    to an A origin URL.

For (1) we expect SameSite strict cookies to be sent because
window.open() creates a top-level context that will have a populated
site-for-cookies and the initiator is same-origin (regardless of the
cross-site ancestor chain).

For (2) we expect only SameSite=None cookies to be sent. This is
because setting the location results in a navigation to an A1->B->A3
nested frame with an empty site-for-cookies.

We currently fail the passthrough and change-request cases for (2).
We plan to fix this as part of storage partitioning with an ancestor
chain bit in the StorageKey. See:

privacycg/storage-partitioning#25

This CL also includes some minor cleanup of the WPT test and associated
resources.

Bug: 1115847
Change-Id: I9002e60a271ae95d1d702068d44b30bd0e33b5dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3277058
Reviewed-by: Steven Bingler <bingler@chromium.org>
Commit-Queue: Ben Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/main@{#944293}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Chromium project.

This CL adds a number of new cases to the service worker SameSite
cookies test.  The cases break down into two general types:

1. Cases where A1 frames B frames A2, and then A2 calls window.open()
   to an A origin URL.
2. Cases where A1 frames B frames A2, and then A2 sets the location
   to an A origin URL.

For (1) we expect SameSite strict cookies to be sent because
window.open() creates a top-level context that will have a populated
site-for-cookies and the initiator is same-origin (regardless of the
cross-site ancestor chain).

For (2) we expect only SameSite=None cookies to be sent.  This is
because setting the location results in a navigation to an A1->B->A3
nested frame with an empty site-for-cookies.

We currently fail the passthrough and change-request cases for (2).
We plan to fix this as part of storage partitioning with an ancestor
chain bit in the StorageKey.  See:

privacycg/storage-partitioning#25

This CL also includes some minor cleanup of the WPT test and associated
resources.

Bug: 1115847
Change-Id: I9002e60a271ae95d1d702068d44b30bd0e33b5dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3277058
Reviewed-by: Steven Bingler <bingler@chromium.org>
Commit-Queue: Ben Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/main@{#944293}
@foolip
Copy link
Member

foolip commented Nov 23, 2021

This was blocked by #31714, I'll close and reopen in the hope to get the #31715 workaround, which should unblock this.

@foolip foolip closed this Nov 23, 2021
@foolip foolip reopened this Nov 23, 2021
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit bfe98d4 into master Nov 23, 2021
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-3277058 branch November 23, 2021 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants