mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #20443] Security: Missing Tool Access Control in /api/chat/completions - API bypasses UI restrictions #19187
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?
Originally created by @chayaziv on GitHub (Jan 7, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20443
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.43
Ollama Version (if applicable)
No response
Operating System
Ubuntu
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When a user without permission to a Tool (MCP/OpenAPI server) tries to use it, access should be denied both in the UI and when calling the API directly via code.
The server should validate tool access on every request, not rely on UI-side filtering.
Actual Behavior
The tool access control check happens ONLY on the client side (UI).
When users access the UI, the frontend calls
GET /api/v1/toolswhich returns only tools they have access to - so they cannot select restricted tools.However, when users call the API directly via code (Python, curl, etc.), they can use ANY tool by specifying its ID in
tool_ids- the server does not validate access.This is a server-side security vulnerability - access control must be enforced on the server, not just the client.
Steps to Reproduce
The server trusts that the client already filtered the tools - but code bypasses the client entirely.
Logs & Screenshots
--
Additional Information
🛠 Root Cause Analysis
In
backend/open_webui/main.py, thechat_completionfunction checks model access on the server side, but does NOT check tool access.Current code in
backend/open_webui/main.pylines 1552- 1558:✅ Comparison: Where Access Control Works Correctly
UI filtering (client-side only) in
backend/open_webui/routers/tools.pylines 143-149:This only filters what the UI displays - it does NOT prevent direct API access via code.
💡 Proposed Fix
Add server-side tool access validation in
backend/open_webui/main.pyafter model access check:This reuses the same
get_tools()function that filters tools for the UI, ensuring consistent server-side enforcement.Additional Information
Security Impact: Users can bypass UI restrictions and access any tool by calling the API directly via code (Python, curl, Postman, etc.).
Recommended pattern: Access control should ALWAYS be enforced server-side. Client-side filtering is for UX only - never for security.
@owui-terminator[bot] commented on GitHub (Jan 7, 2026):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#20414 issue: Chats can't be archived
by Ithanil • Jan 06, 2026 •
bug#15124 issue: API returns "405 Method Not Allowed" on /v1/chat/completions
by chisel900 • Jun 18, 2025 •
bug#19987 issue: There is a lack of visual consistency between the home page and the chat interface.
by i-iooi-i • Dec 16, 2025 •
bug💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@chayaziv commented on GitHub (Jan 7, 2026):
👎
The issues you brought up are not relevant to my issue.
@tjbck commented on GitHub (Jan 7, 2026):
Addressed in dev.