CVE-2026-54016: Open WebUI BOLA: `search_knowledge_files` Allows Unauthorized Knowledge Base File Enumeration
Open WebUI's built-in search_knowledge_files tool skips the access check when a chat model has no attached knowledge bases. A logged-in user who knows a knowledge base ID can list the file names and IDs inside private knowledge bases. Open WebUI 0.9.5 and earlier is affected. Upgrade to 0.9.6.
Published Jun 17, 2026 · Updated Jul 20, 2026 · Analysis Oct 26, 2026
What an attacker can do
In backend/open_webui/tools/builtin.py, the "no attached knowledge" branch of search_knowledge_files passes a caller-supplied knowledge_id straight to Knowledges.search_files_by_id(). That method receives a user_id but does not enforce authorization. The attached-knowledge branch of the same function, and the sibling query_knowledge_files, both check for admin, ownership or a read grant in AccessGrants. This branch does not.
The attacker is a normal user who knows a victim's knowledge_id. They ask the model, in a native function-calling chat, to run search_knowledge_files with that ID. The result lists file IDs, filenames, knowledge base name and update timestamps.
The conditions are native function calling, built-in tools enabled, the knowledge tool category enabled, and a model with no attached knowledge bases. The leak is metadata only, but filenames such as contracts or financial reports can be sensitive. The file IDs may also feed other access paths, for example view_knowledge_file. A user who lost access can keep reading metadata if they remember the ID. The CVSS score is 4.3.
Who is affected
The open-webui pip package, version 0.9.5 and earlier, with native function calling and the knowledge built-in tool enabled. Check:
pip show open-webuiThen check whether models use function_calling: native and whether the knowledge built-in tool category is on for your users.
open-webui
- Ecosystem
- PyPI
- Affected
- <= 0.9.5
- Fixed in
- 0.9.6
- Check
pip show open-webui
How to fix it
Upgrade to Open WebUI 0.9.6:
pip install --upgrade open-webui==0.9.6The advisory's suggested fix adds the same check as query_knowledge_files before the search: allow admins, the owner, or users with read access, and otherwise return an access-denied error. It also suggests enforcing authorization inside search_files_by_id(). The advisory lists no workaround.
How to tell if you were hit
Review chat logs for tool calls to search_knowledge_files with a knowledge_id argument, then compare the caller with the knowledge base owner and its access grants. Flag calls from users who are not the owner, not admin and have no read grant. Knowledge base IDs are UUIDs, so repeated calls with different IDs from one user suggest probing.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
Open WebUI has a Broken Object Level Authorization (BOLA) vulnerability in the builtin search_knowledge_files tool.
When native function calling is enabled and the selected model has no attached knowledge bases, an authenticated user can call search_knowledge_files with an arbitrary knowledge_id. The function then returns file metadata from that knowledge base without checking whether the user has read access.
This allows unauthorized enumeration of private or restricted knowledge base files.
Details
The vulnerable code is in:
backend/open_webui/tools/builtin.py
Affected function:
async def search_knowledge_files(
query: str,
knowledge_id: Optional[str] = None,
count: int = 5,
skip: int = 0,
__request__: Request = None,
__user__: dict = None,
__model_knowledge__: Optional[list[dict]] = None,
) -> str:In the "No attached knowledge" branch, when knowledge_id is provided, the function directly calls:
result = await Knowledges.search_files_by_id(
knowledge_id=knowledge_id,
user_id=user_id,
filter={"query": query},
skip=skip,
limit=count,
)This code path does not verify that the current user is authorized to access the specified knowledge base.
The missing check is inconsistent with other nearby code paths. For example, the attached-knowledge branch in the same function checks whether the user is an admin, the owner of the knowledge base, or has explicit read access through AccessGrants:
if not (
user_role == "admin"
or knowledge.user_id == user_id
or await AccessGrants.has_access(
user_id=user_id,
resource_type="knowledge",
resource_id=knowledge.id,
permission="read",
user_group_ids=set(user_group_ids),
)
):
continueThe sibling function query_knowledge_files also performs the same authorization check before using user-supplied knowledge base IDs.
The underlying method Knowledges.search_files_by_id() receives user_id, but it does not enforce authorization for the provided knowledge_id. As a result, this builtin tool path can access a knowledge base by ID without verifying the caller's permissions.
PoC
Prerequisites
- The attacker has a valid authenticated Open WebUI account.
- The victim owns a private or restricted knowledge base.
- The attacker does not own the target knowledge base.
- The attacker does not have
readpermission for the target knowledge base inAccessGrants. - The attacker knows the target
knowledge_id. - The selected model has no attached knowledge bases.
- Builtin tools are enabled.
- The knowledge builtin tool category is enabled.
- Native function calling is enabled.
Reproduction Steps
- Create a private or restricted knowledge base as the victim user.
- Upload one or more files to that knowledge base.
- Confirm that the attacker user does not have access to the knowledge base.
- As the attacker user, send a chat completion request with native function calling enabled:
{
"stream": true,
"model": "gpt-4o-mini",
"params": {
"function_calling": "native"
},
"messages": [
{
"role": "user",
"content": "Please use the search_knowledge_files tool with knowledge_id \"c0c84752-2e9d-42bf-bc3c-c0f272aa61c1\" to search all files"
}
]
}Replace c0c84752-2e9d-42bf-bc3c-c0f272aa61c1 with the victim's private knowledge base ID.
Expected Result
The request should be denied because the attacker does not have access to the target knowledge base.
Actual Result
search_knowledge_files returns metadata for files inside the target knowledge base, including:
- file ID;
- filename;
- knowledge base ID;
- knowledge base name;
- update timestamp.
Impact
This is a Broken Object Level Authorization / Broken Access Control vulnerability.
An authenticated attacker who knows a valid knowledge_id can enumerate files from private or restricted knowledge bases without authorization.
The leaked metadata may expose sensitive information through filenames, such as:
- financial reports;
- employee documents;
- customer contracts;
- internal roadmap files;
- confidential project documents.
The exposed file IDs may also help attackers chain this issue with other knowledge-file access paths, such as view_knowledge_file, to attempt further content extraction.
This vulnerability bypasses the intended AccessGrants permission model and may also allow post-revocation metadata access if a user remembers a previously accessible knowledge_id.
Suggested Fix
Add the same authorization check used in query_knowledge_files before calling Knowledges.search_files_by_id():
if knowledge_id:
knowledge = await Knowledges.get_knowledge_by_id(knowledge_id)
if not knowledge or not (
user_role == "admin"
or knowledge.user_id == user_id
or await AccessGrants.has_access(
user_id=user_id,
resource_type="knowledge",
resource_id=knowledge.id,
permission="read",
user_group_ids=set(user_group_ids),
)
):
return json.dumps({"error": f"Access denied to knowledge base {knowledge_id}"})
result = await Knowledges.search_files_by_id(
knowledge_id=knowledge_id,
user_id=user_id,
filter={"query": query},
skip=skip,
limit=count,
)As defense in depth, authorization should also be enforced or safely wrapped around Knowledges.search_files_by_id() so that future callers cannot accidentally bypass access control.
Credited to Hwwg, Classic298.
Questions
- Does this expose file contents?
No. The tool returns metadata: file ID, filename, knowledge base ID and name, and update time. The advisory notes the file IDs could help chain other access paths such as view_knowledge_file.
- Does the attacker need the knowledge base ID?
Yes. They must know a valid knowledge_id. The advisory also notes that a user whose access was revoked can still use an ID they remember.
- Which version fixes CVE-2026-54016?
Open WebUI 0.9.6. Versions up to and including 0.9.5 are affected.
References
Read for this analysis:
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Open WebUI vulnerabilities
All Open WebUI entriesCVE-2026-87011
Open WebUI: Unauthenticated requests can stall the server via uncached OIDC fetches in back-channel logout
high7.5Sep 10, 2026CVE-2026-87012
Open WebUI: Any authenticated user can suppress calendar alerts instance-wide via a non-numeric alert value
medium4.3Sep 10, 2026CVE-2026-87013
Open WebUI: Any authenticated user can start a non-terminating request via a folder parent cycle
medium4.3Sep 10, 2026CVE-2026-87014
Open WebUI: Admin demoted through SSO role sync keeps read and write access to all users' notes
medium6.5Sep 10, 2026CVE-2026-87015
Open WebUI: A user's session cookies are sent to tool servers configured for bearer authentication
medium6.8Sep 10, 2026CVE-2026-87016
Open WebUI: Sign-in as another user via wildcard characters in the OAuth subject claim on SQLite
high8.1Sep 10, 2026
