mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[PR #14624] [CLOSED] Patch security risk with public /cache endpoint #110838
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/14624
Author: @rragundez
Created: 6/3/2025
Status: ❌ Closed
Base:
dev← Head:auth-cache📝 Commits (2)
3f6cf7cRemove extension from images and add user.id in path1ad263bAdd protected endpoint for /cache📊 Changes
2 files changed (+21 additions, -7 deletions)
View changed files
📝
backend/open_webui/main.py(+14 -2)📝
backend/open_webui/utils/middleware.py(+7 -5)📄 Description
The
/cacheendpoint is unprotected and any file that is created in that directory will automatically be available without any auth.This PR adds protection over this endpoint to be available only to users of the app but also to only the user specific that created the image.
In addition it is recommended to remove the extension of the file being written as load balancer and similar systems could activate cache if the extension is kept as it is identified as a file, and if cache is activated then it defeats the purpose of authentication as it will serve the file directly without triggering the logic of the endpoint.
For now the only place I see it being used is for the images, which I already patched in this PR.
I tested but Please test from your side.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.