mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #23541] [CLOSED] fix: null-check file owner, timing-safe SCIM token, GCS nested paths #42876
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/23541
Author: @barry3406
Created: 4/9/2026
Status: ❌ Closed
Base:
main← Head:fix/multiple-backend-bugs📝 Commits (3)
bf23d00fix: add null check for file owner in get_html_file_content_by_ide7d76c1fix: use timing-safe comparison for SCIM bearer token02ff05bfix: correct GCS filename extraction for nested paths📊 Changes
3 files changed (+5 additions, -4 deletions)
View changed files
📝
backend/open_webui/routers/files.py(+1 -1)📝
backend/open_webui/routers/scim.py(+2 -1)📝
backend/open_webui/storage/provider.py(+2 -2)📄 Description
Summary
Three independent backend bug fixes:
1. Server crash when file owner is deleted (
files.py)Users.get_user_by_id()returnsNonewhen the file owner has been deleted, but.roleis accessed without a null check. Any authenticated user requesting that file gets a 500 Internal Server Error.Fix: Add
not file_user orguard before accessing.role.2. SCIM token vulnerable to timing attack (
scim.py)The SCIM bearer token is compared with
!=, which short-circuits on the first differing character. This allows brute-forcing the token by measuring response time. The codebase already useshmac.compare_digestinutils/auth.pyfor similar purposes.Fix: Replace
token != scim_tokenwithnot hmac.compare_digest(token, scim_token).3. GCS provider breaks on nested paths (
provider.py)get_fileanddelete_filein the GCS provider usesplit('/')[1]to extract the filename, which returns the wrong segment for paths with subdirectories (e.g.gs://bucket/subdir/file.txtreturnssubdirinstead offile.txt). The S3 provider correctly usessplit('/')[-1].Fix: Change
[1]to[-1]in both methods.Test Plan
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.