/

CVE-2026-45402

Severity:

HIGH RISK

(8.1)

Broken Access Control in Open WebUI Knowledge & Folder APIs

CVE-2026-45402

Analyzed

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-639

Impact:

Unauthorized Data Access and Modification

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Open WebUI prior to 0.9.5 exposes a broken access control issue where several endpoints accept a user-supplied file_id and attach that file to resources controlled by the caller without checking file ownership or sharing permissions.

Any authenticated user who knows another user's file UUID can cause that file to be linked into their own folders or knowledge bases, making the content readable through downstream RAG and file-content paths and, in some cases, allowing knowledge-base entries to be overwritten.

Affected context

This vulnerability occurs in Open WebUI deployments where:

  • Users can upload or own private files that are later referenced by UUID-based identifiers.
  • The backend exposes endpoints for updating folders and knowledge bases that take a file_id as input.
  • Authorization checks verify access to the target resource (folder or knowledge base) but do not verify access to the source file being attached.

It specifically affects:

  • POST /api/v1/folders/{id}/update in backend/open_webui/routers/folders.py
  • add_file_to_knowledge_by_id in backend/open_webui/routers/knowledge.py
  • add_files_to_knowledge_by_id_batch in backend/open_webui/routers/knowledge.py

Exploit preconditions

  • Attack surface: Application backend APIs that manage folders and knowledge bases.
  • Required access: Any authenticated account capable of:
  • Calling the folder update or knowledge add-file endpoints.
  • Providing arbitrary file_id values.
  • Trigger point: Supplying the UUID of a file owned by another user as the file_id parameter when adding or updating folder or knowledge-base contents.
  • Why exploitation is possible: The server trusts the file_id parameter and only verifies that the caller can mutate the target folder/knowledge resource, not that they have rights to the referenced file. This leads to an Insecure Direct Object Reference style flaw (CWE-639), where resource identifiers can be used to access objects outside the user's authorization scope.

Why this happens

The core bug is a missing authorization check on secondary resources referenced by identifier.

The APIs correctly model ownership or permissions for the target containers (folders and knowledge bases) but treat file_id as a trusted, globally valid handle without enforcing that:

  • The calling user owns the file, or
  • The file has been explicitly shared with or is otherwise accessible to the caller.

This falls under CWE-639: Authorization Bypass Through User-Controlled Key, where user-supplied identifiers are used to locate and attach backend resources without confirming access rights.

Conceptually, the system conflates knowledge of an ID with authorization to use that ID, allowing cross-tenant or cross-user data linkage and therefore data exfiltration and overwriting.

Potential impact

  • Any authenticated user could:
  • Attach another user's private file to their own folder or knowledge base given its UUID.
  • Read the contents of that file through RAG workflows or file-content endpoints.
  • Knowledge-base entries derived from the unauthorized file could:
  • Be indexed and surfaced in responses, leaking sensitive information.
  • Be modified or overwritten when the attached file is used as a source, impacting data integrity.
  • Multi-user deployments could experience:
  • Cross-account data exposure of proprietary or confidential documents.
  • Accidental or intentional tampering with another user's curated knowledge-base content.

General mitigation guidance

Effective mitigation focuses on tightening authorization checks and decoupling identifier knowledge from access rights:

  • Treat all user-supplied identifiers (e.g., file_id, UUID) as untrusted and enforce authorization at every dereference.
  • Introduce ownership and access-control checks whenever a file is attached to another resource:
  • Verify that the caller is the file owner or has been granted explicit access.
  • Limit cross-context linkage by:
  • Scoping identifiers per user, tenant, or workspace where feasible.
  • Using capability-style tokens or access grants rather than raw IDs in multi-tenant contexts.
  • Apply least-privilege design to resource manipulation APIs:
  • Separate endpoints for read vs. write operations.
  • Restrict who can attach or update shared knowledge-base content.
  • Normalize authorization logic:
  • Centralize access-control decisions in reusable helpers or middleware to avoid per-endpoint omissions.

How teams detect issues like this

Organizations can look for this class of issue using a combination of review and automated checks:

  • Static analysis and code review:
  • Flag endpoints that accept identifiers such as file_id, document_id, or resource_id and then dereference them from global stores.
  • Verify that every dereference includes an explicit authorization check tying the resource to the current user, tenant, or access-policy context.
  • Access-control testing:
  • Include tests where a low-privileged account attempts to use another user's identifiers in file-attachment or linking APIs.
  • Fuzz APIs with guessed or enumerated UUIDs to detect cross-user access.
  • Logging and monitoring:
  • Log cross-user resource references (e.g., mismatches between file owner and caller) and treat them as potential security incidents.
  • Policy enforcement:
  • Use CI/CD gates or automated review tools that enforce patterns such as "no direct lookup by user-supplied ID without an ownership constraint" in sensitive modules.

Sources

SourceLink
github.comgithub.com/open-webui/open-webui/security/advisories/GHSA-r472-mw7m-967f

Frequently asked

questions

The issue is exploitable by any authenticated user who can call the affected endpoints and learns or guesses another user's file UUID. It does not require administrative privileges, but it does require access to the application and the ability to interact with folder or knowledge APIs.

An attacker must have a valid Open WebUI account with permission to manage their own folders or knowledge bases. With that access, they can attempt to attach files they do not own by providing their UUIDs as file_id parameters.

The safest pattern is to enforce strict ownership or access-control checks whenever user input references another resource. For each file_id, the server should verify that the current user is authorized to access that file before attaching it to any folder or knowledge base, and it should deny the operation otherwise.

To prevent similar problems:

  • Treat all IDs coming from clients as untrusted.
  • Standardize authorization middleware or helpers that validate both the target resource and any referenced resources.
  • Incorporate access-control test cases into QA and automated testing.
  • Conduct periodic reviews focused specifically on cross-resource operations like linking, copying, or attaching objects.
Find out what's already
exploitable in your codebase.