Root cause
Authentication & access control
The query change removes the owner/admin guard before adding an existing file collection.
How AI contributed: Flawed AI-written codePublished Aug 2, 2026 in
open-webui/open-webuiAll 2 findings in this repository
Provisional finding. Full causal and release verification remains incomplete.
Root cause
The query change removes the owner/admin guard before adding an existing file collection.
Fix
The direct-model helper filters supplied knowledge with the authenticated user before storing request state.
Case facts
@@ -1829,11 +1829,11 @@ collection_names.append(item_id) elif item_type == "file": # Individual file - use file-{id} as collection name file = Files.get_file_by_id(item_id)- if file and (user_role == "admin" or file.user_id == user_id):+ if file: collection_names.append(f"file-{item_id}") elif item_type == "note": # Note - always return full content as context note = Notes.get_note_by_id(item_id)@@ -1036,5 +1036,16 @@+async def _set_direct_model(request: Request, model_item: dict, user) -> None:+ model_meta = (model_item.get('info') or {}).get('meta') or {}+ knowledge_items = model_meta.get('knowledge')+ if knowledge_items:+ from open_webui.utils.access_control.files import get_accessible_folder_files++ model_meta['knowledge'] = await get_accessible_folder_files(knowledge_items, user)+ request.state.direct = True+ request.state.model = model_item++ @app.post('/api/chat/completions') @app.post('/api/v1/chat/completions') # Experimental: Compatibility with OpenAI API async def chat_completion( request: Request, form_data: dict,AI-assisted change 76f12eb632c414f9bb25d34aaa1e4f3d79d7168be930f96dc0c70fe3cc8f6793 · Fix 36d206b5e672fe41bd043094c836628eae39a15027f967ca2639a51191ba86a2