Summary
Open WebUI versions prior to 0.9.0 contain a broken authorization check that allows any authenticated user to permanently delete files owned by other users via the /api/v1/files/{id} endpoint, as long as those files are referenced in a shared chat.
Because file UUIDs are exposed through knowledge base listing APIs and the has_access_to_file() gate does not verify the requester or operation type, attackers can target and remove other users' data in shared contexts.
Affected context
This issue arises in Open WebUI deployments where:
- Multiple users share chats or knowledge bases that reference uploaded files
- Users can list knowledge base files via
GET /api/v1/knowledge/{id}/files - The same file objects are reused across users and shared resources
In such contexts, any authenticated user with read access to a shared chat or knowledge base may be able to see file identifiers and then call the file deletion API against files they do not own.
Exploit preconditions
- Attack surface: HTTP API endpoints exposed by the Open WebUI backend
- Required access: Valid authenticated user account (no special privileges required)
- Information disclosure: Ability to retrieve file UUIDs through
GET /api/v1/knowledge/{id}/filesor other listing endpoints - Trigger point: Sending a
DELETE /api/v1/files/{id}request for a file that is referenced in any shared chat - Why exploitation is possible: The
has_access_to_file()authorization function grants access based solely on the file being in a shared chat branch, without: - Verifying that the requesting user owns the file, and
- Distinguishing between read operations and destructive actions like deletion
Why this happens
The core problem is an authorization design flaw where access checks are tied to an overly broad condition: "file is referenced in a shared chat," treated as sufficient for all operations on that file.
This maps to CWE-639: Authorization Bypass Through User-Controlled Key, because the server trusts a client-supplied file identifier (UUID) to authorize a privileged operation without revalidating ownership or operation context. The same has_access_to_file() gate is reused for both read and delete actions, but only validates that the file appears in a shared context, not whether the user is allowed to perform destructive operations on another user's resource.
Potential impact
- Unauthorized permanent deletion of files owned by other users
- Loss of training data, documents, or knowledge base content referenced in shared chats
- Disruption of collaborative workflows that rely on shared files
- Potential denial of service for specific users or teams through targeted file removal
- Erosion of trust in multi-user deployments where data isolation is expected
General mitigation guidance
Effective mitigation focuses on tightening authorization and separating concerns between resource identification, ownership, and operation type:
- Enforce ownership-aware checks in file APIs: verify that the requester is the file owner or has an explicitly granted role that permits deletion, independent of whether the file is in a shared chat.
- Differentiate permissions by operation: use distinct policies for read, update, and delete, rather than a single "has access" check that covers all verbs.
- Avoid treating shared visibility as delete permission: sharing a file or chat should not implicitly grant all participants destructive rights over the underlying resources.
- Limit identifier exposure to only what is necessary, and ensure that listing endpoints return only files that the caller is authorized to operate on.
- Apply least privilege to authenticated users, giving them only the minimum capabilities needed for their role (e.g., read-only participants in shared chats).
How teams detect issues like this
Organizations can detect similar authorization flaws by:
- Reviewing API controllers and routing logic for endpoints that:
- Accept resource identifiers from clients, and
- Perform destructive or state-changing operations without explicit ownership checks.
- Using static analysis or custom linting rules to flag:
- Shared authorization helpers used across different HTTP methods (GET vs DELETE) without operation-aware checks
- Direct use of user-supplied IDs in critical operations without secondary validation
- Conducting targeted code reviews around:
- "has_access" or "can_access" functions to ensure they factor in user identity and action type
- Endpoints that handle file, document, or object deletion in multi-tenant or multi-user environments
- Implementing access-control testing in CI pipelines, including:
- Automated tests for cross-user access attempts
- Policy-as-code frameworks that describe which roles may delete which resources

