Summary
Open WebUI's memories API applies inconsistent authorization checks, allowing a standard user to view, delete, and restore other users' memories when a valid memory identifier is known.
This becomes risky in multi-user deployments where untrusted users share an instance, as one account can access or tamper with another user's stored conversational data.
Affected context
The issue occurs in Open WebUI deployments that:
- Expose the
/api/v1/memoriesendpoints to multiple non-admin users - Rely on per-user separation of "memories" for privacy or isolation
- Expect the backend to enforce user-level access control based on ownership of memory records
In these contexts, user identity is not consistently verified against the owner of the memory resource for several API paths, weakening isolation between users.
Exploit preconditions
- Attack surface: HTTP API endpoints under
/api/v1/memories - Required access: Valid non-admin user account on the same Open WebUI instance (no special privileges)
- Trigger points:
POST /api/v1/memories/queryto retrieve memory contentPOST /api/v1/memories/{memory_id}/updateto leak or restore contentDELETE /api/v1/memories/{memory_id}to delete existing memories- Why exploitation is possible: The application trusts the provided
memory_idwithout consistently verifying that it belongs to the calling user, enabling horizontal access across user boundaries.
Why this happens
This vulnerability stems from incomplete authorization logic on resource-specific endpoints.
Instead of deriving accessible resources from the authenticated user's context, the API allows clients to directly reference arbitrary memory_id values and performs operations without robust ownership checks.
This pattern matches CWE-639: Authorization Bypass Through User-Controlled Key, where user-supplied identifiers are used to locate and manipulate objects without enforcing proper access control rules.
Potential impact
- Unauthorized viewing of other users' memory contents, including sensitive conversational history
- Deletion of other users' memories, disrupting their workflows or data integrity
- Restoration and leakage of previously deleted memories belonging to other users
- Erosion of trust in multi-user or shared Open WebUI environments due to cross-tenant data exposure
General mitigation guidance
Mitigation typically centers on enforcing strict, centralized authorization checks on all resource-level endpoints:
- Derive accessible memory records from the authenticated user's identity rather than accepting arbitrary
memory_idvalues as-is. - Apply consistent owner or role checks on every read, update, delete, and query path related to memories.
- Use server-side filtering so that search or query endpoints only ever return objects belonging to the requesting user or an explicitly allowed scope.
- Adopt a defense-in-depth model that treats IDs in the request as hints, not as proof of entitlement, and validates them against the user's allowed resource set.
- Consider minimizing the exposure of stable, guessable identifiers by using opaque or scoped tokens tied to both user and resource.
How teams detect issues like this
Detection can focus on both code-level and runtime indicators:
- Static analysis and code review:
- Search for controller or handler code using path parameters like
{memory_id}without explicit checks that the resource belongs to the current user. - Flag endpoints where authorization appears to occur only at authentication time (login) and not per-resource.
- Look for direct repository or ORM calls that fetch by ID alone without scoping queries by user identifier.
- Runtime and policy enforcement:
- Enable audit logging for memory-related operations, including caller identity and
memory_id, and review for cross-user access patterns. - Use automated tests or security regression tests that attempt cross-account access to ensure isolation.
- Integrate API gateways or middleware that enforce ownership or tenant checks before backend handlers execute.

