Open WebUI Missing Authorization on Tool Update Endpoint Allows Privilege Escalation to Code Execution
Open WebUI is vulnerable to privilege escalation and code execution because a missing authorization check on the tool update endpoint allows a user with write access to a tool to replace the tool's server-side Python content and trigger execution, bypassing the intended `workspace.tools` security boundary.
Open WebUI’s tool update endpoint (POST /api/v1/tools/id/{id}/update) lacks the workspace.tools permission check that is enforced on the tool creation endpoint. This flaw permits a user, explicitly denied tool management permissions, to replace a tool’s server-side Python code and execute it. The vulnerability breaks the intended security policy where workspace.tools is the trust boundary for code execution. A write access grant on a single tool is sufficient to bypass workspace.tools entirely, leading to code execution by an untrusted user. This vulnerability exists in the main branch of the Open WebUI project.
Attack Chain
- An administrator deploys Open WebUI with the default configuration.
- The administrator enables
workspace.toolspermission for a trusted user, Alice. - Alice creates a tool with benign Python code.
- Alice grants
writeaccess to the tool to an untrusted user, Bob, for collaboration purposes. - The administrator disables the global
workspace.toolspermission. - Bob updates the tool’s content via the
POST /api/v1/tools/id/{id}/updateendpoint with malicious Python code. - Due to the missing
workspace.toolscheck, the malicious code is executed on the server. - Bob achieves code execution and potentially gains unauthorized access to sensitive information or systems.
Impact
This vulnerability allows an untrusted user to bypass intended security restrictions and execute arbitrary code on the Open WebUI server. Successful exploitation can lead to privilege escalation, potentially granting the attacker full control over the Open WebUI instance and access to sensitive data. The impact includes potential data breaches, system compromise, and unauthorized access to connected systems. The vulnerability affects all installations where an administrator has granted write access to tools to users without workspace.tools permissions, even if the global workspace.tools permission is subsequently revoked.
Recommendation
- Apply the patch provided by Open WebUI to re-introduce the
workspace.toolspermission check on the tool update endpoint. - Deploy the Sigma rule
Detect Open WebUI Tool Update Endpoint Bypassto detect attempts to exploit this vulnerability based on request paths. - Review existing user permissions and revoke write access to tools for any untrusted users who do not have the
workspace.toolspermission. - Monitor web server logs for suspicious POST requests to the
/api/v1/tools/id/{id}/updateendpoint (categorywebserver) originating from unexpected IP addresses.
Detection coverage 2
Detect Open WebUI Tool Update Endpoint Bypass
criticalDetects attempts to exploit the Open WebUI privilege escalation vulnerability (GHSA-p4fx-23fq-jfg6) by monitoring POST requests to the tool update endpoint without proper authorization.
Detect Python Code Execution in Open WebUI Tool Updates
highDetects potential code execution attempts in Open WebUI tool updates by identifying suspicious keywords and functions in the content being updated.
Detection queries are available on the platform. Get full rules →