-
Notifications
You must be signed in to change notification settings - Fork 14k
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
fix: enable strong session protection by default #24256
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24256 +/- ##
==========================================
- Coverage 68.31% 68.22% -0.09%
==========================================
Files 1957 1957
Lines 75596 75597 +1
Branches 8222 8222
==========================================
- Hits 51640 51576 -64
- Misses 21848 21913 +65
Partials 2108 2108
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -1387,6 +1387,8 @@ def EMAIL_HEADER_MUTATOR( # pylint: disable=invalid-name,unused-argument | |||
SESSION_COOKIE_HTTPONLY = True # Prevent cookie from being read by frontend JS? | |||
SESSION_COOKIE_SECURE = False # Prevent cookie from being transmitted over non-tls? | |||
SESSION_COOKIE_SAMESITE: Optional[Literal["None", "Lax", "Strict"]] = "Lax" | |||
# Accepts None, "basic" and "strong", more details on: https://flask-login.readthedocs.io/en/latest/#session-protection | |||
SESSION_PROTECTION = "strong" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it's worth adding something to UPDATING.md
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, more is better then less
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just an FYI - With session protection strong, this breaks selenium drivers connecting to app (which means things like cache warmup and thumbnails don't work). I had to revert to none which worked but didn't test basic. There may be some additional work here to update the machine auth function to properly work when this is enabled |
I am facing the same issue where the Alert&Report are not working properly.
|
Alerts & Reports works for me with
|
ok, thank you for the reports, I'll work on a fix for this |
This reverts commit f898c97.
SUMMARY
Enable strong session protection by default. This is a more secure sane default, more details on: https://flask-login.readthedocs.io/en/latest/#session-protection
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION