← Back to release summary

Allow first-party SameSite=None cookies in sandboxed contexts

Category
Miscellaneous
Type
New or changed feature
Status
In developer trial (Behind a flag) (Chrome In developer trial (Behind a flag))
Intent stage
None

WPT details: https://chromium-review.googlesource.com/c/chromium/src/+/6090256

Summary

Enable a frame to signal the browser to include SameSite=None cookies in first-party requests if third-party cookie (3PC) restrictions are active using the sandbox 'allow-same-site-none-cookies' value.

Motivation

To prevent malicious attacks from untrusted content, servers can include a Content-Security-Policy HTTP header or iframe attribute to sandbox a page. This policy results in the browser treating the page as an opaque origin, which prevents requests originating from this page from including SameSite=Strict/Lax cookies. Considering an example webpage at storage.example.com where users upload untrusted code, the owners may choose to sandbox the page to restrict user scripts from being run. Due to this sandboxing, only SameSite=None cookies can be used for access control. However, this creates an issue if third-party cookies (3PCs) are blocked— particularly for sandboxed frames that are same-site with respect to the top-level site (including possibly the top-level frame itself). All subresource requests from storage.example.com would be considered cross-site in the context of 3PC blocking and requests from these sandboxed pages will no longer even have their SameSite=None cookies. Even though the cookies are not being sent in a truly cross-site context, access-controlled content such as embedded media would not be included on the page. This proposal allows servers to restore existing behavior and ensure these cookies are included in same-site requests, which can mitigate potential 3PC-blocking-related breakage.

Standards & signals

Ecosystem

Samples: https://sandbox-allow-same-site-none-cookies-demo.glitch.me/

Explainers: https://github.com/explainers-by-googlers/csp-sandbox-allow-same-site-none-cookies

View on chromestatus.com