New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 677164 link

Starred by 4 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Cookies not sent on 302 redirects when SameSite=Strict

Reported by ryanholl...@gmail.com, Dec 27 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.44 Safari/537.36

Steps to reproduce the problem:
1. Make POST to end point that returns a cookie with SameSite=Strict
2. Have POST respond with a 302 redirect to same URL (PRG) and set a cookie with SameSite=Strict
3. Notice that the cookie set by the 302 is not sent on the GET request.
3. 

What is the expected behavior?
Since it is a get request on the same page it is expected that the SameSite=Strict cookie is sent.

What went wrong?
Cookies were not sent to the follow on GET request. If you use Lax it works, but it seems according to the SameSite draft spec and the definition of Safe methods (https://tools.ietf.org/html/rfc7231#section-4.2.1) they should be sent.

Did this work before? No 

Chrome version: 55.0.2883.44  Channel: n/a
OS Version: OS X 10.12.1
Flash Version: Shockwave Flash 24.0 r0
 
redirect_login_view.har
5.8 KB Download
Sorry if Security is not the right Type for this, it seemed right when I was choosing from the list.
Components: Internals>Network
Labels: -Type-Bug-Security -Restrict-View-SecurityTeam Type-Bug
Not something we'd usually consider a security bug, but thanks for the report either way. Reclassifying it and removing view restrictions so that the network team can take a look.

Comment 4 by mmenke@chromium.org, Dec 28 2016

Cc: mkwst@chromium.org mmenke@chromium.org
Components: -Internals>Network Internals>Network>Cookies
Labels: -OS-Mac Needs-Feedback OS-All
Status: Untriaged (was: Unconfirmed)
[+mkwst]:  Mind following up on this when you get back?  I'm not too familiar with the expectations here.

I don't think there's enough information here to understand what's going on.

What type of POST is this?  A main frame form?  An iframe form?  And XHR/fatch POST? In the latter two cases, is the domain of main frame the same site as the one the POST is being made to or not?  I'm not the expert here, but I'm guessing that the POST is cross-site, so we consider the GET cross-site as well (Which may or may not be according to spec).
In the attached HAR you can see the request. It is a main frame POST. The initial POST request origin is a different domain, but I don't think that should matter. The POST response sets a cookie:

set-cookie	q2token=50sxdarlr5rr3xmntoeq4o5h; SameSite=Strict

It also a 302 with a location:

location	/uux.aspx?logonErrorReturnCode=0&logonHttpStatusCode=200&logonExternalLogonName=autoret

On the follow on GET to the specified location in the 302, the q2token cookie is not being sent. Removing SameSite=String or making SameSite=Lax WILL pass the cookie properly. 

Comment 6 by mmenke@chromium.org, Dec 28 2016

Labels: -Needs-Feedback
Thanks for the followup!  Removing Needs-Feedback label.

Comment 7 by isa...@npmjs.com, Mar 17 2017

Here's another repro case: https://gist.github.com/isaacs/8d957edab609b4d122811ee945fd92fd

Run the node script, load it up in a browser, and follow the instructions.

It's interesting that clicking the link from within _does_ work, but dragging (or copying) direct to the URL bar does not.

Comment 9 by mmenke@chromium.org, Mar 17 2017

andreaslindpetersen:  Thanks for the pointer, but different issue - that one is almost certainly because we aren't setting required security-related fields on <a download> requests (May also apply to save-link/image/whales-as requests), but since this is a POST request, don't think it's the same issue.

Comment 10 by mkwst@chromium.org, Mar 18 2017

Labels: -OS-All OS-Android OS-Chrome OS-Linux OS-Mac OS-Windows
Owner: mkwst@chromium.org
Status: Assigned (was: Untriaged)
I missed this, thanks for pinging me on Twitter. I'll take a look on Monday when I'm back at a computer.
Cc: chlily@chromium.org mef@chromium.org morlovich@chromium.org
Labels: Hotlist-Cookies
Owner: ----
Status: Untriaged (was: Assigned)
(Unassigning myself, marking untriaged in preparation to retriage with folks who will do a better job taking care of cookies than I've been able to)
Labels: Enterprise-Triaged

Sign in to add a comment