Summary
Open WebUI allows an authenticated user to attach arbitrary file identifiers to their own chat messages without verifying ownership or read permissions.
When such a chat is shared, the platform incorrectly treats attached victim files as accessible through the shared context, enabling unauthorized reading or deletion of other users' files under specific sharing conditions.
Affected context
This vulnerability arises in Open WebUI's file and chat management features, where users can attach file identifiers to chat messages and later share those chats. It is relevant in deployments where multiple users store files in the platform and share chats with each other. The issue appears when the system assumes that a file referenced from a shared chat is accessible, without re-checking whether the requesting user actually owns or has direct permission to the file, leading to cross-user file exposure and manipulation in certain sharing workflows.
Exploit preconditions
- Attack surface: Web-based UI and related HTTP endpoints for chats and file operations.
- Required access: Attacker must have a valid authenticated account on the Open WebUI instance.
- Trigger point: Attacker attaches arbitrary
file_idvalues to a chat message, shares that chat, and then invokes file read or delete endpoints via the shared context. - Why exploitation is possible: The authorization logic (
has_access_to_file()and related checks) relies on chat sharing metadata to infer file access instead of strictly enforcing per-file ownership or explicit permissions, allowing attacker-controlled chat references to bypass proper access control.
Why this happens
The underlying flaw is a broken access control pattern where authorization is inferred indirectly from shared chat relationships rather than enforced directly on the file resource. The system accepts arbitrary file_id values for attachment without validating that the attaching user owns or can read the referenced file. Later, when the chat is shared and access is broadened, the authorization function treats any file associated with that chat as accessible. This maps to CWE-284 (Improper Access Control) and CWE-639 (Authorization Bypass Through User-Controlled Keys), as attacker-chosen identifiers are trusted as evidence of entitlement. It also relates to CWE-862 (Missing Authorization) because file endpoints do not consistently re-check user permissions against the underlying file resource before performing read or delete actions.
Potential impact
- An attacker could read private files belonging to other users by attaching victim file identifiers to their own chats.
- An attacker may delete or otherwise manipulate files stored by other users, causing data loss.
- Sensitive information stored in files, such as prompts, datasets, or configuration details, could be exposed.
- Compromise of user privacy within shared AI workspaces due to unauthorized cross-tenant file access.
General mitigation guidance
Effective mitigation involves enforcing strict, resource-centric access control for file operations and removing reliance on indirect relationships like chat sharing to infer permissions. Typical patterns include:
- Validating ownership or explicit file-level permissions whenever a file is attached to a chat or accessed through any endpoint.
- Treating user-supplied identifiers such as
file_idas untrusted and verifying them against server-side records before accepting associations. - Implementing consistent authorization checks at the file API boundary so that read and delete operations always ensure the caller has rights to the specific file.
- Designing chat sharing mechanisms so that they do not automatically broaden access to unrelated resources unless explicit consent and permission propagation rules are in place.
- Applying least-privilege principles so that users and shared contexts only gain access to the minimal set of files necessary for a given operation.
How teams detect issues like this
Detection strategies can focus on both code-level analysis and runtime monitoring:
- Use static analysis or manual code review to locate places where resource identifiers (e.g.,
file_id) are accepted from clients and used for access decisions without a direct permission check on the resource. - Review authorization logic around chat sharing and file endpoints to ensure that access is validated against the file's ownership rather than inferred from associated objects.
- Implement centralized access control policies for file APIs and verify that all file-related handlers call these checks consistently.
- Monitor logs for suspicious patterns such as a single user accessing or deleting many files they did not create, or frequent failures/successes on file operations involving mixed ownership.

