PT-2026-59371 · Pypi · Open-Webui

Published

2026-07-13

·

Updated

2026-07-13

CVSS v3.1

6.5

Medium

VectorAV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Unauthorized File and Knowledge Base Content Access via RAG Vector Search

Affected Component

RAG source resolution in chat completion pipeline:
  • backend/open webui/retrieval/utils.py (lines 963-965, 1063-1068, 1126-1131 in get sources from items)

Affected Versions

Current main branch (commit 6fdd19bf1) and likely all versions with RAG functionality.

Description

The get sources from items function resolves file and knowledge base references into vector search queries during chat completion. Three of the five code paths perform vector store queries without any authorization check, allowing users to extract content from files and knowledge bases they do not have access to.
PathLinesAccess Check
type: "file", full-context1044-1050has access to file
type: "file", non-full-context (default)1063-1068❌ None
type: "collection"1070-1118✅ Present
type: "text" with collection name963-965❌ None
Bare collection name/collection names1126-1131❌ None
The three unprotected paths pass user-supplied collection names directly to query collection(), which queries the vector store without any authorization. Collection names follow predictable formats: file-<file id> for files and the knowledge base UUID for knowledge bases.

CVSS 3.1 Breakdown

MetricValueRationale
Attack VectorNetwork (N)Exploited remotely via chat completion API
Attack ComplexityLow (L)Single API call with a known resource ID
Privileges RequiredLow (L)Requires a valid user account
User InteractionNone (N)No victim interaction required
ScopeUnchanged (U)Impact within the application's data boundary
ConfidentialityHigh (H)Full content of private files/knowledge bases extractable
IntegrityNone (N)No data modification
AvailabilityNone (N)No denial of service

Attack Scenario

  1. User A uploads a private document and uses it in RAG (the document is embedded into the vector store as collection file-<file id>).
  2. User A shares a chat or model referencing the file with User B, or User B otherwise obtains the file ID through a legitimate interaction.
  3. User A later revokes User B's access to the file.
  4. User B sends a chat completion request referencing the revoked file:
json
POST /api/chat/completions
{
 "model": "any-accessible-model",
 "messages": [{"role": "user", "content": "What does this document say about pricing?"}],
 "files": [{"type": "file", "id": "<revoked file id>"}]
}
  1. The non-full-context path (default) constructs collection name file-<id> and queries the vector store with no access check.
  2. Matching chunks are injected into the LLM context, and the response contains the victim's private file content.
The same attack works via {"type": "text", "collection name": "<knowledge base id>"} for knowledge bases.

Impact

  • Access revocation is ineffective for RAG content — users who previously had access can continue extracting file and knowledge base content indefinitely
  • Private document content can be systematically extracted through targeted queries
  • Breaks the access control model for files and knowledge bases at the RAG layer

Preconditions

  • Attacker must know the file ID or knowledge base ID (UUID) of the target resource
  • The target file/knowledge base must have been processed into the vector store
  • Attacker must have a valid user account

Fix

Found an issue in the description? Have something to add? Feel free to write us 👾

Related Identifiers

PYSEC-2026-2729

Affected Products

Open-Webui