mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 21:09:41 -05:00
[PR #23647] [CLOSED] fix: enforce per-model access on chained base models #50347
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/23647
Author: @Classic298
Created: 4/12/2026
Status: ❌ Closed
Base:
dev← Head:fix/base-model-access-chain-bypass📝 Commits (5)
ad6ea36fix: enforce per-model access on chained base models980dd21fix: preserve HTTPException status in import_models and honor bypass flags in functions.pye874469fix: thread bypass flag into ollama.py secondary base-model checks7a0fd37fix: enforce base-model grants for admins and preserve 403 at dispatch402881bfix: fold admin bypass into runtime base-model checks in openai/ollama📊 Changes
6 files changed (+187 additions, -5 deletions)
View changed files
📝
backend/open_webui/functions.py(+9 -1)📝
backend/open_webui/main.py(+22 -1)📝
backend/open_webui/routers/models.py(+47 -1)📝
backend/open_webui/routers/ollama.py(+37 -1)📝
backend/open_webui/routers/openai.py(+17 -1)📝
backend/open_webui/utils/access_control/__init__.py(+55 -0)📄 Description
When a custom model declares base_model_id, the access check on the user-facing wrapper did not extend to the base it forwards to. A caller with read access to the wrapper (ownership or grant) could reach an upstream model they were not authorized for.
Add a helper that re-runs the model access check against the resolved base, and wire it in at two layers: upfront when persisting a chain (create/import/update) so callers cannot plant bases they cannot read, and at dispatch time in every chat completion router path so access revocations after chain creation are still honored.
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.