mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #23490] [CLOSED] fix: restrict shared chat file access to require valid share_id #27221
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/23490
Author: @Classic298
Created: 4/7/2026
Status: ❌ Closed
Base:
dev← Head:fix/file-access-shared-chat📝 Commits (1)
6360b4cfix: restrict shared chat file access to require valid share_id📊 Changes
9 files changed (+74 additions, -26 deletions)
View changed files
📝
backend/open_webui/routers/files.py(+32 -10)📝
backend/open_webui/utils/access_control/files.py(+12 -5)📝
src/lib/components/chat/Messages/Markdown/HTMLToken.svelte(+2 -2)📝
src/lib/components/chat/Messages/Markdown/MarkdownInlineTokens.svelte(+2 -1)📝
src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte(+2 -2)📝
src/lib/components/common/Image.svelte(+9 -2)📝
src/lib/stores/index.ts(+1 -0)📝
src/lib/utils/index.ts(+7 -2)📝
src/routes/s/[id]/+page.svelte(+7 -2)📄 Description
Previously, any authenticated user could access files attached to any shared chat by guessing the file UUID. The has_access_to_file function granted access if a file appeared in ANY shared chat, without verifying the requester had legitimate access to that specific share.
Backend: has_access_to_file now requires either chat ownership or a matching share_id to grant shared-chat file access. All file endpoints accept an optional share_id query parameter.
Frontend: A shareId store is set when viewing a shared chat (/s/{id}) and cleared on navigation away. Markdown components and the token replacement utility append ?share_id= to file content URLs when set, enabling authorized file access for shared chat viewers.
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.