-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
SameSite Setting for Cookies #5583
Comments
Yes, this is a good idea, also see gogs/gogs#3525 (comment) for other cookie options. |
What is the state on this? |
Not implemented to my knowledge. Browsers are moving towards enabling it by default, so the issue might solve itself eventually: https://blog.chromium.org/2019/10/developers-get-ready-for-new.html |
But this is not true for other settings that can increase security, right? For example the others you mentioned, like |
@alexanderadam |
Ah okay, I didn't know that. Thank you for pointing out, Dimitri. 👍 |
While waiting for these flags to be set at the application level, I found a workaround which consists in setting cookie flags at the web server level. For instance with
If your instance of |
FYI, the corresponding
Here, the |
Fix go-gitea#5583 Signed-off-by: Andrew Thornton <art27@cantab.net>
Add SameSite setting for cookies and rationalise the cookie setting code. Switches SameSite to Lax by default. There is a possible future extension of differentiating which cookies could be set at Strict by default but that is for a future PR. Fix #5583 Signed-off-by: Andrew Thornton <art27@cantab.net>
[x]
):Description
The SameSite setting should be enabled on the session and CSRF cookies as an added prevention against CSRF. Mozilla does a good job of explaining its purpose, but the gist is that it prevents cookies being sent in a request initiated from a foreign origin.
Screenshots
N/A
The text was updated successfully, but these errors were encountered: