Summary
Open WebUI versions prior to 0.9.5 contain a missing authorization check on the tool update API endpoint, allowing users without tool management permissions to modify existing tools' server-side Python code.
Under these conditions, an untrusted user can bypass the intended workspace.tools security boundary and cause arbitrary code execution in the backend context.
Affected context
The vulnerability appears in Open WebUI deployments where:
- Multiple users share a workspace and rely on fine-grained permissions such as workspace.tools
- Administrators explicitly deny certain users the ability to manage or execute custom tools
- The tool update functionality is exposed via the REST API (POST /api/v1/tools/id/{id}/update)
In this context, users who are meant to be restricted from code execution can still reach the vulnerable endpoint and update existing tools' server-side Python content.
Exploit preconditions
- Attack surface: HTTP API endpoint
POST /api/v1/tools/id/{id}/update - Required access: Valid user account within the workspace (no tool-management permission, but general access)
- Trigger point: Submitting a crafted update request targeting an existing tool to replace its server-side Python implementation
- Why exploitation is possible: The update endpoint omits the workspace.tools permission check that is enforced on tool creation, so the server does not verify that the caller is authorized to modify tool code.
Why this happens
This issue stems from inconsistent enforcement of authorization logic across related endpoints.
While the tool creation path enforces the workspace.tools permission, the corresponding tool update path does not perform the same check.
Conceptually, this is a CWE-269: Improper Privilege Management and closely related to CWE-862: Missing Authorization, where a security-sensitive operation (modifying server-side Python tooling) is exposed without verifying that the caller holds the needed permission.
The insecure pattern is fragmented authorization rules: some endpoints enforce the boundary, while others inadvertently bypass it, allowing privilege escalation through a less-protected path.
Potential impact
- Untrusted users may update existing tools' Python code and cause arbitrary code execution on the server.
- Compromise of application integrity through unauthorized logic changes in tools.
- Lateral movement within the environment if modified tools can access additional data or services.
- Potential exposure or manipulation of user data processed by the affected tools.
- Erosion of administrative security guarantees around code-execution boundaries in shared workspaces.
General mitigation guidance
Mitigation focuses on consistent, centralized authorization enforcement for all security-sensitive operations.
Useful patterns include:
- Applying the same permission checks (e.g., workspace.tools or equivalent capability) to every endpoint that creates, updates, or deletes tools.
- Implementing a shared authorization layer or middleware so that business logic cannot bypass permission checks accidentally.
- Treating any operation that changes or introduces executable server-side code as a privileged action requiring explicit capabilities.
- Applying least-privilege role assignments, ensuring that general users do not receive broad rights that indirectly permit code execution.
- Logging and reviewing administrative changes to executable components, making unexpected modifications easier to detect and roll back.
How teams detect issues like this
Detection can combine code-level analysis with runtime monitoring:
- Static analysis and code review: Look for endpoints or service methods that update tools, scripts, or code artifacts and verify they consistently invoke authorization checks. Absence of permission enforcement alongside operations touching executable content is a red flag.
- Authorization policy review: Ensure that permission models (such as workspace.tools) are defined centrally and referenced uniformly across APIs rather than embedded ad hoc in controller methods.
- Runtime monitoring: Enable detailed audit logs for tool modifications, including who changed what and when, to spot suspicious updates from users lacking expected privileges.
- Automated tests: Introduce regression tests that simulate constrained users attempting to create or update tools and verify that access is denied; integrate these tests into CI.

