CVE-2026-59217: Open WebUI Upload `metadata.knowledge_id` Bypasses The Knowledge-base Vulnerability

MODERATE
Advisory Identifier: GHSA-7r7x-gjvr-448g
CVSS 4.3
CWE-862 CWE-863
Published
Advisory Summary

CVE-2026-59217 is a MODERATE (CVSS 4.3) upload `metadata.knowledge_id` bypasses the knowledge-base vulnerability (CWE-862: Missing Authorization) affecting Open WebUI libraries in the PyPI ecosystem. The issue involves upload `metadata.knowledge_id` bypasses the knowledge-base write-access check (read-only users can add files to kb). Remediation is available by upgrading affected packages to version 0.10.0.

CVE-2026-59217 at a Glance

CVE Identifier CVE-2026-59217
GHSA Identifier GHSA-7r7x-gjvr-448g
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-862: Missing Authorization
Affected Product Open WebUI
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:N/I:L/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 None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-59217

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.10.0
pip install open-webui>=0.10.0
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-59217, 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.10.0), 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-862: Missing Authorization, where the product does not perform an authorization check when an actor attempts to access a resource or perform an action. 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

# Open WebUI upload metadata can add files to knowledge bases without write permission ## Summary Open WebUI's file upload background processing trusts the client-supplied `metadata.knowledge_id` value and inserts a `knowledge_file` association before validating that the uploading user has write access to the target knowledge base. A verified user with only read access to a knowledge base can upload an arbitrary file and set `metadata={"knowledge_id":"<target knowledge id>"}`. The normal `/api/v1/knowledge/{id}/file/add` endpoint correctly requires knowledge-base write access, but the upload auto-link path bypasses that authorization check. The immediate result is unauthorized modification of the target knowledge base's file membership. The attached attacker-controlled file becomes visible through `/api/v1/knowledge/{id}/files`, and readers/owners of that knowledge base can retrieve the file through the normal file endpoints because file access is derived from `KnowledgeFile` membership. ## Affected Version - Repository: `open-webui/open-webui` - Tested source commit: `02dc3e689ceac915a870b373318b99c029ddf603` - Package version observed in `package.json`: `0.9.6` - Package name: `open-webui` ## Impact A read-only knowledge-base collaborator can perform a write operation against that knowledge base by attaching arbitrary uploaded files. Security impact: - Unauthorized knowledge-base membership modification. - Integrity impact on shared knowledge-base file listings. - Attacker-controlled files become readable to other users who can read the target knowledge base. - If an owner/admin later reprocesses or globally reindexes the knowledge base, the unauthorized file can be indexed into the knowledge collection, turning the membership bypass into RAG/content poisoning. This is not an unauthenticated issue. It requires a verified Open WebUI account and a valid target knowledge-base ID. The clearest exploit path is a user who legitimately has read access to a knowledge base but not write access. ## Source Evidence The normal single-file knowledge add endpoint checks write permission before processing or inserting the relationship: - `backend/open_webui/routers/knowledge.py` - `add_file_to_knowledge_by_id` - Lines 714-728 reject callers who are not owner, admin, or granted `write` access. - Lines 750-766 then process and insert the file only after that authorization gate. The upload auto-link path does not perform the same check: - `backend/open_webui/routers/files.py` - `process_uploaded_file` - Lines 178-186 read `knowledge_id` from upload metadata and immediately call `Knowledges.add_file_to_knowledge_by_id(...)`. - Lines 187-192 call `process_file(... collection_name=knowledge_id ...)` after the insert. The model method inserts the relationship without validating the caller's write access to the knowledge base: - `backend/open_webui/models/knowledge.py` - `add_file_to_knowledge_by_id` - Lines 646-677 create and commit a `KnowledgeFile` row for the supplied `knowledge_id`, `file_id`, and `user_id`. The later vector write check exists, but it runs too late: - `backend/open_webui/routers/retrieval.py` - `process_file` - Lines 1587-1592 call `_validate_collection_access(..., access_type='write')` when a collection is supplied. Because the unauthorized `KnowledgeFile` row is already committed before that check runs, the failed vector processing does not undo the knowledge-base file association. The upload code catches the exception at `backend/open_webui/routers/files.py` lines 194-195 and logs a warning while leaving the row in place. The unauthorized relationship affects file access decisions: - `backend/open_webui/utils/access_control/files.py` - `has_access_to_file` - Lines 41-53 grant file access when a file is associated with a knowledge base the user can access. So once the attacker's file is inserted into the target `KnowledgeFile` table, target knowledge-base readers/owners can see and fetch that file through normal knowledge/file routes. ## Reproduction Steps Use a local Open WebUI instance with two verified users: 1. As user `owner`, create a knowledge base. 2. Grant user `reader` read access to the knowledge base, but do not grant write access. 3. As `reader`, confirm the normal add-file endpoint is blocked: ```http POST /api/v1/knowledge/<knowledge_id>/file/add Authorization: Bearer <reader token> Content-Type: application/json {"file_id":"<reader-owned-file-id>"} ``` Expected and observed behavior for the normal route: it rejects the request because `reader` lacks knowledge-base write access. 4. As `reader`, upload a new file with the same target knowledge ID embedded in upload metadata: ```http POST /api/v1/files/?process=true&process_in_background=false Authorization: Bearer <reader token> Content-Type: multipart/form-data file=@attacker-note.txt metadata={"knowledge_id":"<knowledge_id>"} ``` 5. Observe that the upload request succeeds and returns the uploaded file record. 6. As `owner`, request the knowledge-base files: ```http GET /api/v1/knowledge/<knowledge_id>/files Authorization: Bearer <owner token> ``` 7. Observe that `attacker-note.txt` appears in the target knowledge base even though `reader` did not have write access. 8. As `owner`, request the file content: ```http GET /api/v1/files/<attacker_file_id>/content Authorization: Bearer <owner token> ``` 9. Observe that the file is retrievable because `has_access_to_file` derives access from the unauthorized knowledge-base membership. ## Expected Behavior The upload auto-link path should enforce the same authorization contract as `/api/v1/knowledge/{id}/file/add`: - The target knowledge base must exist. - The caller must be the knowledge owner, an admin, or have `write` access. - The supplied `directory_id`, if present, must belong to the target knowledge base. - The `KnowledgeFile` association should only be inserted after authorization and processing succeed. ## Actual Behavior `metadata.knowledge_id` causes `Knowledges.add_file_to_knowledge_by_id(...)` to insert a `KnowledgeFile` row before write authorization is checked. The later collection write validation can fail, but the unauthorized membership row remains committed. ## Suggested Fix Move knowledge-base authorization before the insert in the upload auto-link path. The upload path should share the same write-access and directory validation logic used by the dedicated knowledge endpoints. One safe pattern: 1. Load the target knowledge base. 2. Require owner/admin/write access before calling `Knowledges.add_file_to_knowledge_by_id`. 3. Validate that `directory_id`, if supplied, belongs to the same knowledge base. 4. Run vector processing before inserting the membership row, or wrap processing plus insertion in a transaction/compensating cleanup so a denied or failed process cannot leave a stale unauthorized row.

CVE-2026-59217 Affected Open WebUI Versions

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

References

Frequently Asked Questions

What is CVE-2026-59217?
CVE-2026-59217 is a security vulnerability in Open WebUI involving Upload `metadata.knowledge_id` bypasses the knowledge-base write-access check (read-only users can add files to KB) under CWE-862: Missing Authorization.
Which Open WebUI versions are affected?
Affected versions include releases prior to 0.10.0 across affected packages: open-webui.
What version fixes CVE-2026-59217?
Upgrading to 0.10.0 (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.10.0. Upgrade your dependency to 0.10.0 or later.
What is the CVSS score of CVE-2026-59217?
CVE-2026-59217 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:N/I:L/A:N.
What CWE is associated with CVE-2026-59217?
CVE-2026-59217 is classified under CWE-862: Missing Authorization (The product does not perform an authorization check when an actor attempts to access a resource or perform an action.).
How can I check PyPI dependencies for CVE-2026-59217?
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-7r7x-gjvr-448g",
  "modified" : "2026-07-24T17:02:14Z",
  "published" : "2026-07-24T17:02:14Z",
  "aliases" : [ "CVE-2026-59217" ],
  "summary" : "Open WebUI: Upload `metadata.knowledge_id` bypasses the knowledge-base write-access check (read-only users can add files to KB)",
  "details" : "# Open WebUI upload metadata can add files to knowledge bases without write permission\n\n## Summary\n\nOpen WebUI's file upload background processing trusts the client-supplied `metadata.knowledge_id` value and inserts a `knowledge_file` association before validating that the uploading user has write access to the target knowledge base.\n\nA verified user with only read access to a knowledge base can upload an arbitrary file and set `metadata={\"knowledge_id\":\"<target knowledge id>\"}`. The normal `/api/v1/knowledge/{id}/file/add` endpoint correctly requires knowledge-base write access, but the upload auto-link path bypasses that authorization check.\n\nThe immediate result is unauthorized modification of the target knowledge base's file membership. The attached attacker-controlled file becomes visible through `/api/v1/knowledge/{id}/files`, and readers/owners of that knowledge base can retrieve the file through the normal file endpoints because file access is derived from `KnowledgeFile` membership.\n\n## Affected Version\n\n- Repository: `open-webui/open-webui`\n- Tested source commit: `02dc3e689ceac915a870b373318b99c029ddf603`\n- Package version observed in `package.json`: `0.9.6`\n- Package name: `open-webui`\n\n## Impact\n\nA read-only knowledge-base collaborator can perform a write operation against that knowledge base by attaching arbitrary uploaded files.\n\nSecurity impact:\n\n- Unauthorized knowledge-base membership modification.\n- Integrity impact on shared knowledge-base file listings.\n- Attacker-controlled files become readable to other users who can read the target knowledge base.\n- If an owner/admin later reprocesses or globally reindexes the knowledge base, the unauthorized file can be indexed into the knowledge collection, turning the membership bypass into RAG/content poisoning.\n\nThis is not an unauthenticated issue. It requires a verified Open WebUI account and a valid target knowledge-base ID. The clearest exploit path is a user who legitimately has read access to a knowledge base but not write access.\n\n## Source Evidence\n\nThe normal single-file knowledge add endpoint checks write permission before processing or inserting the relationship:\n\n- `backend/open_webui/routers/knowledge.py`\n- `add_file_to_knowledge_by_id`\n- Lines 714-728 reject callers who are not owner, admin, or granted `write` access.\n- Lines 750-766 then process and insert the file only after that authorization gate.\n\nThe upload auto-link path does not perform the same check:\n\n- `backend/open_webui/routers/files.py`\n- `process_uploaded_file`\n- Lines 178-186 read `knowledge_id` from upload metadata and immediately call `Knowledges.add_file_to_knowledge_by_id(...)`.\n- Lines 187-192 call `process_file(... collection_name=knowledge_id ...)` after the insert.\n\nThe model method inserts the relationship without validating the caller's write access to the knowledge base:\n\n- `backend/open_webui/models/knowledge.py`\n- `add_file_to_knowledge_by_id`\n- Lines 646-677 create and commit a `KnowledgeFile` row for the supplied `knowledge_id`, `file_id`, and `user_id`.\n\nThe later vector write check exists, but it runs too late:\n\n- `backend/open_webui/routers/retrieval.py`\n- `process_file`\n- Lines 1587-1592 call `_validate_collection_access(..., access_type='write')` when a collection is supplied.\n\nBecause the unauthorized `KnowledgeFile` row is already committed before that check runs, the failed vector processing does not undo the knowledge-base file association. The upload code catches the exception at `backend/open_webui/routers/files.py` lines 194-195 and logs a warning while leaving the row in place.\n\nThe unauthorized relationship affects file access decisions:\n\n- `backend/open_webui/utils/access_control/files.py`\n- `has_access_to_file`\n- Lines 41-53 grant file access when a file is associated with a knowledge base the user can access.\n\nSo once the attacker's file is inserted into the target `KnowledgeFile` table, target knowledge-base readers/owners can see and fetch that file through normal knowledge/file routes.\n\n## Reproduction Steps\n\nUse a local Open WebUI instance with two verified users:\n\n1. As user `owner`, create a knowledge base.\n2. Grant user `reader` read access to the knowledge base, but do not grant write access.\n3. As `reader`, confirm the normal add-file endpoint is blocked:\n\n```http\nPOST /api/v1/knowledge/<knowledge_id>/file/add\nAuthorization: Bearer <reader token>\nContent-Type: application/json\n\n{\"file_id\":\"<reader-owned-file-id>\"}\n```\n\nExpected and observed behavior for the normal route: it rejects the request because `reader` lacks knowledge-base write access.\n\n4. As `reader`, upload a new file with the same target knowledge ID embedded in upload metadata:\n\n```http\nPOST /api/v1/files/?process=true&process_in_background=false\nAuthorization: Bearer <reader token>\nContent-Type: multipart/form-data\n\nfile=@attacker-note.txt\nmetadata={\"knowledge_id\":\"<knowledge_id>\"}\n```\n\n5. Observe that the upload request succeeds and returns the uploaded file record.\n6. As `owner`, request the knowledge-base files:\n\n```http\nGET /api/v1/knowledge/<knowledge_id>/files\nAuthorization: Bearer <owner token>\n```\n\n7. Observe that `attacker-note.txt` appears in the target knowledge base even though `reader` did not have write access.\n8. As `owner`, request the file content:\n\n```http\nGET /api/v1/files/<attacker_file_id>/content\nAuthorization: Bearer <owner token>\n```\n\n9. Observe that the file is retrievable because `has_access_to_file` derives access from the unauthorized knowledge-base membership.\n\n## Expected Behavior\n\nThe upload auto-link path should enforce the same authorization contract as `/api/v1/knowledge/{id}/file/add`:\n\n- The target knowledge base must exist.\n- The caller must be the knowledge owner, an admin, or have `write` access.\n- The supplied `directory_id`, if present, must belong to the target knowledge base.\n- The `KnowledgeFile` association should only be inserted after authorization and processing succeed.\n\n## Actual Behavior\n\n`metadata.knowledge_id` causes `Knowledges.add_file_to_knowledge_by_id(...)` to insert a `KnowledgeFile` row before write authorization is checked. The later collection write validation can fail, but the unauthorized membership row remains committed.\n\n## Suggested Fix\n\nMove knowledge-base authorization before the insert in the upload auto-link path. The upload path should share the same write-access and directory validation logic used by the dedicated knowledge endpoints.\n\nOne safe pattern:\n\n1. Load the target knowledge base.\n2. Require owner/admin/write access before calling `Knowledges.add_file_to_knowledge_by_id`.\n3. Validate that `directory_id`, if supplied, belongs to the same knowledge base.\n4. Run vector processing before inserting the membership row, or wrap processing plus insertion in a transaction/compensating cleanup so a denied or failed process cannot leave a stale unauthorized row.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "open-webui"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.10.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/open-webui/open-webui/security/advisories/GHSA-7r7x-gjvr-448g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-59217"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-webui/open-webui/pull/26001"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-webui/open-webui/commit/b7626f05fb92b24ab923ad81a037071ebd5623d1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/open-webui/open-webui"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-webui/open-webui/releases/tag/v0.10.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862", "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-24T17:02:14Z",
    "nvd_published_at" : "2026-07-09T17:17:02Z"
  }
}