Summary
Quivr versions through 0.0.322 do not consistently verify that an authenticated user owns the chat identified by a request. An attacker with a valid account may read private conversation histories, delete other users' chats, or add fabricated messages to them by referencing chat identifiers they do not control.
Affected context
The vulnerability occurs in Quivr chat-management endpoints when authenticated requests identify chats by a user-controlled chat_id without reliably checking ownership. The affected operations include retrieving chat history, deleting chats, and submitting question answers. Risk is higher where chat identifiers can be discovered, guessed, leaked, or reused across accounts and where conversations contain private knowledge-base content.
Exploit preconditions
- Attack surface: Authenticated HTTP API endpoints for chat history, deletion, and message submission
- Required access: A valid Quivr user account or other permitted API authentication
- Trigger point: A request to
/chat/{chat_id}/history,/chat/{chat_id}, or/chat/{chat_id}/question/answer - Why exploitation is possible: The server may process a supplied chat identifier without confirming that the authenticated principal owns or is authorized to access the referenced chat
Why this happens
The underlying flaw is missing object-level authorization at the API boundary. The application accepts a chat identifier from an authenticated request but does not consistently bind the requested object to the current user or an explicitly authorized tenant. This behavior maps to CWE-639: Authorization Bypass Through User-Controlled Key, in which changing or supplying an object reference can expose or modify another user's resource.
Potential impact
- Attackers may read private conversation histories and knowledge-base content
- Attackers could delete chats belonging to other users
- Attackers may inject misleading or fabricated messages into another user's conversation
- Confidentiality, integrity, and user trust in chat records could be affected
- Organizations could experience cross-account data exposure or workflow disruption
General mitigation guidance
Mitigation generally focuses on enforcing object-level authorization for every operation involving a user-controlled resource identifier.
Common defensive patterns include:
- Applying server-side ownership or tenant checks before every read, update, delete, and message-creation operation
- Deriving the effective user or tenant from the authenticated session rather than request parameters
- Centralizing authorization checks in reusable policy or repository layers to reduce endpoint omissions
- Returning consistent authorization failures without revealing whether another user's chat exists
- Using least-privilege service identities and isolating tenant data at the storage layer where practical
- Treating identifiers as references only, never as evidence of authorization
How teams detect issues like this
Organizations commonly detect this class of issue through:
- Static analysis and code review checks for database lookups keyed only by request-supplied identifiers
- Review of every endpoint that accepts
chat_idor another object key - Tests that authenticate as one user and attempt read, delete, and write operations against another user's resources
- API gateway or policy enforcement requiring explicit subject-to-object authorization decisions
- Monitoring for repeated access attempts involving many unrelated or sequential chat identifiers
- Automated security testing tools that exercise broken object-level authorization scenarios

