Bug 1998235 - Firefox warning: Cookie “csrf-token” will be soon rejected
Summary: Firefox warning: Cookie “csrf-token” will be soon rejected
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.9
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.10.0
Assignee: Yadan Pei
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-26 16:36 UTC by Samuel Padgett
Modified: 2022-03-10 16:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Version: 4.9.0-0.nightly-2021-08-26-040328 Cluster ID: 37daa945-0f9e-45d1-aa4d-14f23fb522f8 Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0
Last Closed: 2022-03-10 16:05:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
csrf-token SameSite set to 'Lax' (256.95 KB, image/png)
2021-09-27 03:29 UTC, Yadan Pei
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 10124 0 None open Bug 1998235: Set csrf-token cookie's SameSite attribute to None for https 2021-09-22 15:55:16 UTC
Red Hat Product Errata RHSA-2022:0056 0 None None None 2022-03-10 16:06:11 UTC

Description Samuel Padgett 2021-08-26 16:36:01 UTC
I see the following warning in the Firefox developer console. We need to look at the `Set-Cookie` response header we use for this cookie. Opening as a medium severity for now, but we might need to raise severity if it will break our CSRF checks in later Firefox versions.

> Cookie “csrf-token” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

Comment 1 Jakub Hadvig 2021-09-17 07:32:38 UTC
*** Bug 2004894 has been marked as a duplicate of this bug. ***

Comment 2 Jakub Hadvig 2021-09-22 13:49:15 UTC
Wasnt able to reproduce the warning using FF 92.0 (latest). In which version have you seen the issue?

Comment 3 Samuel Padgett 2021-09-22 14:28:24 UTC
Hm, I no longer see the warning, but I believe it's still an issue. See

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite

and

https://groups.google.com/g/mozilla.dev.platform/c/nx2uP0CzA9k/m/BNVPWDHsAQAJ

I think what we want is `SameSite=None; Secure` IF https is enabled. For http, we can probably just leave `SameSite` off the cookie.

It looks like they removed the warning.

> Note: On older browser versions you might get a warning that the cookie will be blocked in future.

Comment 4 Samuel Padgett 2021-09-22 16:33:55 UTC
Sorry, I misread the doc on this. I think we simply want to always set `SameSite=Lax`, and that should work for http and https. We probably want `SameSite=Lax` on the session token as well.

Comment 7 Yadan Pei 2021-09-27 03:29:03 UTC
Created attachment 1826507 [details]
csrf-token SameSite set to 'Lax'

SameSite in csrf-token is set to "Lax", see screenshot

Verified on 4.10.0-0.nightly-2021-09-26-233013

Comment 11 errata-xmlrpc 2022-03-10 16:05:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.10.3 security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0056


Note You need to log in before you can comment on or make changes to this bug.