Summary
Open WebUI contains an authorization gap where knowledge base collections identified by raw UUIDs are not validated by _validate_collection_access().
Any authenticated user who learns another user's private knowledge base UUID can read from, inject into, or overwrite that knowledge base through retrieval query and write endpoints, despite the primary knowledge API denying access.
Affected context
The issue arises in Open WebUI deployments where:
- Knowledge bases are stored in collections named only by UUIDs.
- The
_validate_collection_access()helper enforces access checks solely based on certain collection name prefixes (e.g.,user-memory-*,file-*). - Retrieval query and write endpoints accept a collection identifier and trust it without additional ownership checks for knowledge-base collections.
In this context, any authenticated tenant who can discover or guess a target knowledge base UUID may interact with that collection through the retrieval APIs, even if the central knowledge API denies them access.
Exploit preconditions
- Attack surface: HTTP(S) retrieval query and write endpoints, including:
- Read/query endpoints for knowledge bases.
- Write endpoints such as
/process/text,/process/file,/process/files/batch,/process/web,/process/youtube. - Required access: Valid authenticated user account on the same Open WebUI instance (no elevated privileges needed).
- Knowledge required: The UUID of a target private knowledge base belonging to another user or tenant.
- Trigger point: Supplying the target knowledge base UUID as the collection identifier to affected retrieval endpoints.
- Why exploitation is possible: The access-control helper checks only certain collection name prefixes and does not apply ownership or permission checks for collections named as bare UUIDs, creating an insecure direct object reference (IDOR) condition.
Why this happens
The root cause is a broken access control pattern where object-level authorization is applied inconsistently across API layers.
_validate_collection_access() enforces ownership and visibility rules for specific collection naming patterns (like user-memory-* and file-*) but omits equivalent checks for knowledge base collections that use raw UUIDs.
This mismatch between the authorization model (knowledge API correctly enforcing access) and the retrieval endpoints (trusting UUID collections without validation) maps to CWE-639: Authorization Bypass Through User-Controlled Key, a classic insecure direct object reference where user-supplied identifiers are used to select resources without verifying the caller's entitlement to those resources.
Potential impact
- An authenticated user could read another user's private knowledge base content, exposing confidential prompts, documents, or organizational knowledge.
- Attackers could inject misleading or malicious content into another user's knowledge base, influencing future retrieval results.
- Existing knowledge base entries could be overwritten, causing data loss or intentional knowledge corruption.
- Multi-tenant deployments could experience cross-tenant data exposure or contamination if UUIDs are accessible across tenants.
- Downstream AI-assisted workflows may be manipulated, leading to incorrect outputs, biased responses, or untrusted decision support.
General mitigation guidance
Effective mitigation focuses on enforcing consistent object-level authorization wherever collections or knowledge bases are accessed:
- Apply the same ownership and permission checks to all collection types, including those identified by raw UUIDs, not just prefix-based collections.
- Centralize access control logic so that any endpoint that reads from or writes to a knowledge base delegates to the same authorization layer used by the core knowledge API.
- Treat collection identifiers as untrusted input; always verify that the authenticated user is allowed to access the referenced collection before performing any action.
- Use internal, non-guessable identifiers combined with server-side mapping to user/tenant context, rather than trusting user-supplied identifiers alone for authorization decisions.
- Introduce least-privilege semantics where endpoints operate within the caller's scoped collections derived from their identity, instead of accepting arbitrary collection IDs from the request.
How teams detect issues like this
Detection typically involves analyzing both code and runtime behavior:
- Static analysis / code review:
- Search for endpoints that accept collection IDs, UUIDs, or other direct references and ensure they invoke a common authorization routine.
- Look for authorization helpers that only handle certain naming patterns or prefixes, leaving other resource types unchecked.
- Flag patterns where identifiers from request parameters are used directly in queries or storage calls without a prior entitlement check.
- Runtime monitoring:
- Log access to knowledge bases with user identity, collection ID, and operation type; alert on cross-user access patterns.
- Monitor for unusual write activity to knowledge bases from unexpected accounts or tenants.
- Security testing / policy enforcement:
- Include IDOR-style tests in API security assessments, verifying that authenticated users cannot access collections belonging to others by changing IDs.
- Integrate automated API security scanners that attempt to reuse resource IDs across sessions and users to detect missing object-level authorization.

