From 13c53b89c1edcfa43d70c5701e89a6ce0a07f238 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 2 Apr 2026 14:54:55 +0200 Subject: [PATCH] . (#171) --- backend/open_webui/tools/builtin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/open_webui/tools/builtin.py b/backend/open_webui/tools/builtin.py index e0b9abb461..e052c54cd2 100644 --- a/backend/open_webui/tools/builtin.py +++ b/backend/open_webui/tools/builtin.py @@ -2881,6 +2881,8 @@ async def upload_file_to_terminal( local_path = Storage.get_file(file_record.path) # --- 2. Resolve terminal connection --- + from open_webui.utils.access_control import has_connection_access + terminal_url = None headers = {} @@ -2889,6 +2891,8 @@ async def upload_file_to_terminal( (c for c in connections if c.get('id') == terminal_id), None ) if connection: + if not has_connection_access(UserModel(**__user__), connection): + return json.dumps({'error': 'Access denied to terminal server'}) terminal_url = connection.get('url', '').rstrip('/') auth_type = connection.get('auth_type', 'bearer') if auth_type == 'bearer':