mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-22 14:13:08 -05:00
[PR #6054] [MERGED] fix: set token cookie secure and samesite per config #8614
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/6054
Author: @jeeteshchel
Created: 10/9/2024
Status: ✅ Merged
Merged: 10/9/2024
Merged by: @tjbck
Base:
dev← Head:bugfix/secure-cookie📝 Commits (1)
a2e889cfix: set oauth token secure and samesite per config📊 Changes
2 files changed (+10 additions, -0 deletions)
View changed files
📝
backend/open_webui/apps/webui/routers/auths.py(+8 -0)📝
backend/open_webui/main.py(+2 -0)📄 Description
Enhance Cookie Security Settings
Description
This pull request enhances the security of session cookies by adding
samesiteandsecureattributes to cookie settings within the authentication and session management functions. These changes aim to improve the application's resilience against cross-site request forgery (CSRF) attacks and ensure that cookies are only transmitted over secure channels.Changelog
Added
samesiteandsecureattributes to the cookie settings in the following functions:get_session_usersigninsignupoauth_callbackChanged
auths.pyandmain.pyfiles to include the new cookie attributes.Security
samesiteandsecureattributes to mitigate CSRF attacks and ensure cookies are transmitted securely.Note to first-time contributors
Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Pull Request Checklist
devbranch.Additional Information
Screenshots or Videos
This pull request aims to improve the security of session management within the application. If there are any questions or further clarifications needed, please let me know. Thank you for reviewing and considering these changes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.