CVE-2026-54009: Open WebUI Cross-user File Disclosure Vulnerability

MODERATE
Advisory Identifier: GHSA-wch8-mhj5-9frg
CVSS 6.5
CWE-639
Published
Advisory Summary

CVE-2026-54009 is a MODERATE (CVSS 6.5) cross-user file disclosure vulnerability (CWE-639: Authorization Bypass Through User-Controlled Key) affecting Open WebUI libraries in the PyPI ecosystem. The issue involves cross-user file disclosure via /api/chat/completions image_url field. Remediation is available by upgrading affected packages to version 0.9.6.

CVE-2026-54009 at a Glance

CVE Identifier CVE-2026-54009
GHSA Identifier GHSA-wch8-mhj5-9frg
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-639: Authorization Bypass Through User-Controlled Key
Affected Product Open WebUI
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:H/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 High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-54009

To remediate this vulnerability, upgrade all affected Open WebUI 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-54009, inspect your installed packages using pip:

pip show open-webui

Analyze the terminal output to locate any version of Open WebUI 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, 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 `POST /api/chat/completions` accepts an `image_url.url` value that, when it does NOT start with `http://`, `https://`, or `data:image/`, is interpreted as a file id and resolved against the global file table with no ownership check. An authenticated user can therefore set `image_url.url` to another user's file id, the server reads that file from disk, base64-encodes it, and injects the data URI into the LLM request. The user then prompts the LLM to describe / OCR the file and reads the content back. Same class as CVE-2026-44560 (RAG cross-user access) and the multiple `has_access_to_file` checks added in `routers/files.py` -- the auth boundary was tightened on the file router but not on this conversion path. ## affected code `backend/open_webui/utils/middleware.py:2113-2150` -- `convert_url_images_to_base64`: ```python async def convert_url_images_to_base64(form_data): messages = form_data.get('messages', []) for message in messages: content = message.get('content') if not isinstance(content, list): continue new_content = [] for item in content: if not isinstance(item, dict) or item.get('type') != 'image_url': new_content.append(item) continue image_url = item.get('image_url', {}).get('url', '') if image_url.startswith('data:image/'): new_content.append(item) continue try: base64_data = await get_image_base64_from_url(image_url) # <-- no `user` passed if base64_data: new_content.append({'type': 'image_url', 'image_url': {'url': base64_data}}) ``` called from the main chat completion middleware at `middleware.py:2357`: ```python form_data = await convert_url_images_to_base64(form_data) ``` `backend/open_webui/utils/files.py:57-95` -- `get_image_base64_from_url`: ```python async def get_image_base64_from_url(url: str) -> Optional[str]: try: if url.startswith('http'): validate_url(url) # ... SSRF-safe fetch with allow_redirects=AIOHTTP_CLIENT_ALLOW_REDIRECTS ... else: file = await Files.get_file_by_id(url) # <-- NO user_id filter if not file: return None file_path = await asyncio.to_thread(Storage.get_file, file.path) file_path = Path(file_path) if file_path.is_file(): with open(file_path, 'rb') as image_file: encoded_string = base64.b64encode(image_file.read()).decode('utf-8') content_type = mimetypes.guess_type(file_path.name)[0] or (file.meta or {}).get('content_type') ... return f'data:{content_type};base64,{encoded_string}' ``` `Files.get_file_by_id` in `models/files.py:161` does a bare `db.get(File, id)` -- no ownership filter. there is a separate `Files.get_file_by_id_and_user_id` at line 172 that does filter on `user_id`, and the file router uses `has_access_to_file(id, 'read', user, db)` at `routers/files.py:626` etc. neither check exists on this path. ## reproduction 1. As user A, upload any file (image works cleanly, pdf works if a vision-capable model is configured). Note the file id from the upload response, e.g. `c7f1d8e3-...`. 2. As user B, POST to `/api/v1/chat/completions` with body: ```json { "model": "<any vision model>", "messages": [ { "role": "user", "content": [ {"type": "text", "text": "transcribe everything you can see in this image"}, {"type": "image_url", "image_url": {"url": "c7f1d8e3-..."}} ] } ] } ``` Server reads user A's file from disk, base64-encodes it, and sends to the LLM as user B's image attachment. LLM response contains the file content. ## file id discovery File ids are UUIDs and not enumerable directly, but they leak via: - shared chats / channels containing the original upload - knowledge base members can see ids of files contributed by others - a user who can read a folder index sees the file ids of files inside - chat history exports (`/api/v1/chats/{id}`) include file ids - the user themselves can be tricked into pasting / sharing an id (less likely) ## impact Any authenticated user can read any other user's file content (image and any file with an image-guess mimetype path) via this channel. Severity is bounded by what the LLM will accept in `image_url` -- in practice, image files work cleanly with any vision model; pdf / docx work with multi-modal providers that accept them. ## suggested fix Thread the authenticated user through to `get_image_base64_from_url` and resolve the file via `Files.get_file_by_id_and_user_id(id, user.id)` (or `has_access_to_file(id, 'read', user, db)` if shared-via-knowledge-base access is intended). Same pattern that's already used in `routers/files.py:626` and elsewhere. minimal patch sketch: ```diff --- a/backend/open_webui/utils/files.py +++ b/backend/open_webui/utils/files.py @@ -57,7 +57,7 @@ -async def get_image_base64_from_url(url: str) -> Optional[str]: +async def get_image_base64_from_url(url: str, user=None) -> Optional[str]: try: if url.startswith('http'): ... else: - file = await Files.get_file_by_id(url) + file = (await Files.get_file_by_id_and_user_id(url, user.id) + if user is not None else None) + if file is None: + # fall back to access-grant check for shared files + file = await Files.get_file_by_id(url) + if file and not await has_access_to_file(url, 'read', user): + return None ``` and pipe `user` through `convert_url_images_to_base64(form_data, user)` from the middleware caller. happy to send a PR once you confirm the fix shape you want. ## variant note this was found via patch-diffing existing advisories. the same bug class likely exists in any other site that calls `Files.get_file_by_id` without an adjacent `has_access_to_file` / `get_file_by_id_and_user_id` check. quick grep: ``` git grep -n 'Files\.get_file_by_id(' -- 'backend/open_webui/**' ``` worth a sweep across utils/ and routers/ for missed sites. ## environment Open-webui main branch as of commit `3660bc0` (2026-05-10). python 3.x backend. confirmed by reading the source; no instance stood up.

CVE-2026-54009 Affected Open WebUI 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-54009?
CVE-2026-54009 is a security vulnerability in Open WebUI involving Cross-user file disclosure via /api/chat/completions image_url field under CWE-639: Authorization Bypass Through User-Controlled Key.
Which Open WebUI versions are affected?
Affected versions include releases prior to 0.9.6 across affected packages: open-webui.
What version fixes CVE-2026-54009?
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-54009?
CVE-2026-54009 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-54009?
CVE-2026-54009 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-54009?
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-wch8-mhj5-9frg",
  "modified" : "2026-07-20T21:03:45Z",
  "published" : "2026-06-17T14:11:44Z",
  "aliases" : [ "CVE-2026-54009" ],
  "summary" : "Open WebUI: Cross-user file disclosure via /api/chat/completions image_url field",
  "details" : "## summary\n\n`POST /api/chat/completions` accepts an `image_url.url` value that, when it does NOT start with `http://`, `https://`, or `data:image/`, is interpreted as a file id and resolved against the global file table with no ownership check. An authenticated user can therefore set `image_url.url` to another user's file id, the server reads that file from disk, base64-encodes it, and injects the data URI into the LLM request. The user then prompts the LLM to describe / OCR the file and reads the content back.\n\nSame class as CVE-2026-44560 (RAG cross-user access) and the multiple `has_access_to_file` checks added in `routers/files.py` -- the auth boundary was tightened on the file router but not on this conversion path.\n\n## affected code\n\n`backend/open_webui/utils/middleware.py:2113-2150` -- `convert_url_images_to_base64`:\n\n```python\nasync def convert_url_images_to_base64(form_data):\n    messages = form_data.get('messages', [])\n    for message in messages:\n        content = message.get('content')\n        if not isinstance(content, list):\n            continue\n        new_content = []\n        for item in content:\n            if not isinstance(item, dict) or item.get('type') != 'image_url':\n                new_content.append(item)\n                continue\n            image_url = item.get('image_url', {}).get('url', '')\n            if image_url.startswith('data:image/'):\n                new_content.append(item)\n                continue\n            try:\n                base64_data = await get_image_base64_from_url(image_url)  # <-- no `user` passed\n                if base64_data:\n                    new_content.append({'type': 'image_url',\n                                        'image_url': {'url': base64_data}})\n```\n\ncalled from the main chat completion middleware at `middleware.py:2357`:\n\n```python\nform_data = await convert_url_images_to_base64(form_data)\n```\n\n`backend/open_webui/utils/files.py:57-95` -- `get_image_base64_from_url`:\n\n```python\nasync def get_image_base64_from_url(url: str) -> Optional[str]:\n    try:\n        if url.startswith('http'):\n            validate_url(url)\n            # ... SSRF-safe fetch with allow_redirects=AIOHTTP_CLIENT_ALLOW_REDIRECTS ...\n        else:\n            file = await Files.get_file_by_id(url)        # <-- NO user_id filter\n            if not file:\n                return None\n            file_path = await asyncio.to_thread(Storage.get_file, file.path)\n            file_path = Path(file_path)\n            if file_path.is_file():\n                with open(file_path, 'rb') as image_file:\n                    encoded_string = base64.b64encode(image_file.read()).decode('utf-8')\n                    content_type = mimetypes.guess_type(file_path.name)[0] or (file.meta or {}).get('content_type')\n                    ...\n                    return f'data:{content_type};base64,{encoded_string}'\n```\n\n`Files.get_file_by_id` in `models/files.py:161` does a bare `db.get(File, id)` -- no ownership filter. there is a separate `Files.get_file_by_id_and_user_id` at line 172 that does filter on `user_id`, and the file router uses `has_access_to_file(id, 'read', user, db)` at `routers/files.py:626` etc. neither check exists on this path.\n\n## reproduction\n\n1. As user A, upload any file (image works cleanly, pdf works if a vision-capable model is configured). Note the file id from the upload response, e.g. `c7f1d8e3-...`.\n2. As user B, POST to `/api/v1/chat/completions` with body:\n\n```json\n{\n  \"model\": \"<any vision model>\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\"type\": \"text\", \"text\": \"transcribe everything you can see in this image\"},\n        {\"type\": \"image_url\", \"image_url\": {\"url\": \"c7f1d8e3-...\"}}\n      ]\n    }\n  ]\n}\n```\n\nServer reads user A's file from disk, base64-encodes it, and sends to the LLM as user B's image attachment. LLM response contains the file content.\n\n## file id discovery\n\nFile ids are UUIDs and not enumerable directly, but they leak via:\n\n- shared chats / channels containing the original upload\n- knowledge base members can see ids of files contributed by others\n- a user who can read a folder index sees the file ids of files inside\n- chat history exports (`/api/v1/chats/{id}`) include file ids\n- the user themselves can be tricked into pasting / sharing an id (less likely)\n\n## impact\n\nAny authenticated user can read any other user's file content (image and any file with an image-guess mimetype path) via this channel. Severity is bounded by what the LLM will accept in `image_url` -- in practice, image files work cleanly with any vision model; pdf / docx work with multi-modal providers that accept them.\n\n## suggested fix\n\nThread the authenticated user through to `get_image_base64_from_url` and resolve the file via `Files.get_file_by_id_and_user_id(id, user.id)` (or `has_access_to_file(id, 'read', user, db)` if shared-via-knowledge-base access is intended). Same pattern that's already used in `routers/files.py:626` and elsewhere.\n\nminimal patch sketch:\n\n```diff\n--- a/backend/open_webui/utils/files.py\n+++ b/backend/open_webui/utils/files.py\n@@ -57,7 +57,7 @@\n-async def get_image_base64_from_url(url: str) -> Optional[str]:\n+async def get_image_base64_from_url(url: str, user=None) -> Optional[str]:\n     try:\n         if url.startswith('http'):\n             ...\n         else:\n-            file = await Files.get_file_by_id(url)\n+            file = (await Files.get_file_by_id_and_user_id(url, user.id)\n+                    if user is not None else None)\n+            if file is None:\n+                # fall back to access-grant check for shared files\n+                file = await Files.get_file_by_id(url)\n+                if file and not await has_access_to_file(url, 'read', user):\n+                    return None\n```\n\nand pipe `user` through `convert_url_images_to_base64(form_data, user)` from the middleware caller. happy to send a PR once you confirm the fix shape you want.\n\n## variant note\n\nthis was found via patch-diffing existing advisories. the same bug class likely exists in any other site that calls `Files.get_file_by_id` without an adjacent `has_access_to_file` / `get_file_by_id_and_user_id` check. quick grep:\n\n```\ngit grep -n 'Files\\.get_file_by_id(' -- 'backend/open_webui/**'\n```\n\nworth a sweep across utils/ and routers/ for missed sites.\n\n## environment\n\nOpen-webui main branch as of commit `3660bc0` (2026-05-10). python 3.x backend. confirmed by reading the source; no instance stood up.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/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-wch8-mhj5-9frg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54009"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-wch8-mhj5-9frg"
  }, {
    "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-2766.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://pypi.org/project/open-webui"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-639" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-17T14:11:44Z",
    "nvd_published_at" : "2026-06-23T18:18:06Z"
  }
}