mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-24 20:14:58 -05:00
[PR #613] [CLOSED] Improve session security #7189
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/613
Author: @explorigin
Created: 2/1/2024
Status: ❌ Closed
Base:
main← Head:session-security📝 Commits (10+)
98f4f5aMerge pull request #411 from ollama-webui/latex-render-fix1f930fafeat: rag api endpoint0d260fafeat: chromadb vector store api9dd270cfeat: pdf data loadf69dbf9feat: rag apis added to frontendb280a03feat: frontend file upload supportcaf6999doc: features update20a6f81feat: full integration2a7cfeedoc: feature wording update9abb1cffix: file message styling📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
backend/start.sh(+1 -1)📄 Description
This PR changes a few things around how sessions are handled in order to improve security.
Problem 1: The session secret is hard-coded. Few people will provide their own thus the security of the whole project is a risk for everyone who deploys it.
Solution: One first run, the start script generates a randomly generated session key and stores it to a file. If no secret key is provided, the start script will grab this one. WEBUI_JWT_SECRET_KEY is still accepted. I flagged the line in config.py to be deprecated in the next major release.
Problem 2: JWT signatures were not verified. This makes session stealing easy.
Solution: Remove the option turning off jwt signature verification.
Problem 3: JWTs use email address as the primary method to identify a user. This makes step 2 involve no guesswork at all. If you know someone has session, you can just build the correctly formed JWT and BE them.
Solution: Use database user ids in the JWT instead.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.