CVE-2026-54016: Open WebUI BOLA `search_knowledge_files` Allows Unauthorized Knowledge Base Vulnerability

MODERATE
Advisory Identifier: GHSA-cx9v-4qj2-jrw6
CVSS 4.3
CWE-639 CWE-862
Published
Advisory Summary

CVE-2026-54016 is a MODERATE (CVSS 4.3) `search_knowledge_files` allows unauthorized knowledge base vulnerability (CWE-639: Authorization Bypass Through User-Controlled Key) affecting Open WebUI BOLA libraries in the PyPI ecosystem. The issue involves `search_knowledge_files` allows unauthorized knowledge base file enumeration. Remediation is available by upgrading affected packages to version 0.9.6.

CVE-2026-54016 at a Glance

CVE Identifier CVE-2026-54016
GHSA Identifier GHSA-cx9v-4qj2-jrw6
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-639: Authorization Bypass Through User-Controlled Key
Affected Product Open WebUI BOLA
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-54016

To remediate this vulnerability, upgrade all affected Open WebUI BOLA dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

open-webui fixed: 0.9.6
pip install open-webui>=0.9.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show open-webui

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-54016, inspect your installed packages using pip:

pip show open-webui

Analyze the terminal output to locate any version of Open WebUI BOLA in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.9.6), your application is affected.

Note: The pip show open-webui command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-639: Authorization Bypass Through User-Controlled Key, where the system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. In Open WebUI BOLA, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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: ```python 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: ```python 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`: ```python 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), ) ): continue ``` The 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 `read` permission for the target knowledge base in `AccessGrants`. - 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 1. Create a private or restricted knowledge base as the victim user. 2. Upload one or more files to that knowledge base. 3. Confirm that the attacker user does not have access to the knowledge base. 4. As the attacker user, send a chat completion request with native function calling enabled: ```json { "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()`: ```python 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.

CVE-2026-54016 Affected Open WebUI BOLA Versions

1 component(s)
Fixed Versions:
0.9.6
Product / Package Ecosystem Affected Versions Fixed Version
open-webui
PyPI
< 0.9.6
0.9.6

References

Frequently Asked Questions

What is CVE-2026-54016?
CVE-2026-54016 is a security vulnerability in Open WebUI BOLA involving `search_knowledge_files` Allows Unauthorized Knowledge Base File Enumeration under CWE-639: Authorization Bypass Through User-Controlled Key.
Which Open WebUI BOLA versions are affected?
Affected versions include releases prior to 0.9.6 across affected packages: open-webui.
What version fixes CVE-2026-54016?
Upgrading to 0.9.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is open-webui affected?
Yes, open-webui is affected in releases prior to 0.9.6. Upgrade your dependency to 0.9.6 or later.
What is the CVSS score of CVE-2026-54016?
CVE-2026-54016 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-54016?
CVE-2026-54016 is classified under CWE-639: Authorization Bypass Through User-Controlled Key (The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.).
How can I check PyPI dependencies for CVE-2026-54016?
Run the dependency tree command: 'pip show open-webui'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-cx9v-4qj2-jrw6",
  "modified" : "2026-07-20T21:07:24Z",
  "published" : "2026-06-17T14:31:16Z",
  "aliases" : [ "CVE-2026-54016" ],
  "summary" : "Open WebUI BOLA: `search_knowledge_files` Allows Unauthorized Knowledge Base File Enumeration",
  "details" : "## Summary\n\nOpen WebUI has a Broken Object Level Authorization (BOLA) vulnerability in the builtin `search_knowledge_files` tool.\n\nWhen 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.\n\nThis allows unauthorized enumeration of private or restricted knowledge base files.\n\n## Details\n\nThe vulnerable code is in:\n\n`backend/open_webui/tools/builtin.py`\n\nAffected function:\n\n```python\nasync def search_knowledge_files(\n    query: str,\n    knowledge_id: Optional[str] = None,\n    count: int = 5,\n    skip: int = 0,\n    __request__: Request = None,\n    __user__: dict = None,\n    __model_knowledge__: Optional[list[dict]] = None,\n) -> str:\n```\n\nIn the \"No attached knowledge\" branch, when `knowledge_id` is provided, the function directly calls:\n\n```python\nresult = await Knowledges.search_files_by_id(\n    knowledge_id=knowledge_id,\n    user_id=user_id,\n    filter={\"query\": query},\n    skip=skip,\n    limit=count,\n)\n```\n\nThis code path does not verify that the current user is authorized to access the specified knowledge base.\n\nThe 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`:\n\n```python\nif not (\n    user_role == \"admin\"\n    or knowledge.user_id == user_id\n    or await AccessGrants.has_access(\n        user_id=user_id,\n        resource_type=\"knowledge\",\n        resource_id=knowledge.id,\n        permission=\"read\",\n        user_group_ids=set(user_group_ids),\n    )\n):\n    continue\n```\n\nThe sibling function `query_knowledge_files` also performs the same authorization check before using user-supplied knowledge base IDs.\n\nThe 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.\n\n## PoC\n\n### Prerequisites\n\n- The attacker has a valid authenticated Open WebUI account.\n- The victim owns a private or restricted knowledge base.\n- The attacker does not own the target knowledge base.\n- The attacker does not have `read` permission for the target knowledge base in `AccessGrants`.\n- The attacker knows the target `knowledge_id`.\n- The selected model has no attached knowledge bases.\n- Builtin tools are enabled.\n- The knowledge builtin tool category is enabled.\n- Native function calling is enabled.\n\n### Reproduction Steps\n\n1. Create a private or restricted knowledge base as the victim user.\n\n2. Upload one or more files to that knowledge base.\n\n3. Confirm that the attacker user does not have access to the knowledge base.\n\n4. As the attacker user, send a chat completion request with native function calling enabled:\n\n```json\n{\n  \"stream\": true,\n  \"model\": \"gpt-4o-mini\",\n  \"params\": {\n    \"function_calling\": \"native\"\n  },\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Please use the search_knowledge_files tool with knowledge_id \\\"c0c84752-2e9d-42bf-bc3c-c0f272aa61c1\\\" to search all files\"\n    }\n  ]\n}\n```\n\nReplace `c0c84752-2e9d-42bf-bc3c-c0f272aa61c1` with the victim's private knowledge base ID.\n\n### Expected Result\n\nThe request should be denied because the attacker does not have access to the target knowledge base.\n\n### Actual Result\n\n`search_knowledge_files` returns metadata for files inside the target knowledge base, including:\n\n- file ID;\n- filename;\n- knowledge base ID;\n- knowledge base name;\n- update timestamp.\n\n## Impact\n\nThis is a Broken Object Level Authorization / Broken Access Control vulnerability.\n\nAn authenticated attacker who knows a valid `knowledge_id` can enumerate files from private or restricted knowledge bases without authorization.\n\nThe leaked metadata may expose sensitive information through filenames, such as:\n\n- financial reports;\n- employee documents;\n- customer contracts;\n- internal roadmap files;\n- confidential project documents.\n\nThe 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.\n\nThis vulnerability bypasses the intended `AccessGrants` permission model and may also allow post-revocation metadata access if a user remembers a previously accessible `knowledge_id`.\n\n## Suggested Fix\n\nAdd the same authorization check used in `query_knowledge_files` before calling `Knowledges.search_files_by_id()`:\n\n```python\nif knowledge_id:\n    knowledge = await Knowledges.get_knowledge_by_id(knowledge_id)\n\n    if not knowledge or not (\n        user_role == \"admin\"\n        or knowledge.user_id == user_id\n        or await AccessGrants.has_access(\n            user_id=user_id,\n            resource_type=\"knowledge\",\n            resource_id=knowledge.id,\n            permission=\"read\",\n            user_group_ids=set(user_group_ids),\n        )\n    ):\n        return json.dumps({\"error\": f\"Access denied to knowledge base {knowledge_id}\"})\n\n    result = await Knowledges.search_files_by_id(\n        knowledge_id=knowledge_id,\n        user_id=user_id,\n        filter={\"query\": query},\n        skip=skip,\n        limit=count,\n    )\n```\n\nAs 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "open-webui"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.9.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.9.5"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/open-webui/open-webui/security/advisories/GHSA-cx9v-4qj2-jrw6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54016"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-cx9v-4qj2-jrw6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/open-webui/open-webui"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/open-webui/PYSEC-2026-2721.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://pypi.org/project/open-webui"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-639", "CWE-862" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-17T14:31:16Z",
    "nvd_published_at" : "2026-06-23T18:18:06Z"
  }
}