Hoch

Open WebUI's process_files_batch() endpoint missing ownership check, allows unauthorized file overwrite

  • Veröffentlicht: 27.03.2026
  • Aktualisiert: 11.10.2026 14:17

Summary

Any authenticated user can overwrite any file's content by ID through the POST /api/v1/retrieval/process/files/batch endpoint. The endpoint performs no ownership check, so a regular user with read access to a shared knowledge base can obtain file UUIDs via GET /api/v1/knowledge/{id}/files and then overwrite those files, escalating from read to write. The overwritten content is served to the LLM via RAG, meaning the attacker controls what the model tells other users.

Details

The process_files_batch() function in backend/open_webui/routers/retrieval.py appears to be designed as an internal helper. The knowledge base router (add_files_to_knowledge_batch() in knowledge.py) imports and calls it directly after performing its own ownership and access control checks. The frontend never calls the retrieval route directly; all legitimate UI flows go through the knowledge base wrapper.

However, the function is also exposed as a standalone HTTP endpoint via @router.post(...). This direct route only requires get_verified_user (any authenticated user) and performs no ownership check of its own:

python
for file in form_data.files:
    text_content = file.data.get("content", "")  # attacker-controlled

    file_updates.append(FileUpdateForm(
        hash=calculate_sha256_string(text_content),
        data={"content": text_content},            # written to DB
    ))

for file_update, file_result in zip(file_updates, file_results):
    Files.update_file_by_id(id=file_result.file_id, form_data=file_update)
    #                       ^^^ no ownership check

There is no verification that file.user_id == user.id before the write. Any authenticated user who knows a file UUID can overwrite that file.

How an attacker obtains file UUIDs:

Same as with read access, any user who can see a knowledge base can retrieve file IDs for every document in it via GET /api/v1/knowledge/{id}/files. In deployments where knowledge bases are shared across teams, this gives any regular user a list of valid targets.

Suggested fix: Add an ownership check before writing:

python
for file in form_data.files:
    db_file = Files.get_file_by_id(file.id)
    if not db_file or (db_file.user_id != user.id and user.role != "admin"):
        file_errors.append(BatchProcessFilesResult(
            file_id=file.id, status="failed",
            error="Permission denied: not file owner",
        ))
        continue

Classification:

  • CWE-639: Authorization Bypass Through User-Controlled Key
  • OWASP API1:2023: Broken Object Level Authorization

Tested on Open WebUI 0.8.3 using a default Docker configuration.

PoC

Prerequisites:

  • Default Open WebUI installation (Docker: ghcr.io/open-webui/open-webui:main)
  • An admin or user creates a knowledge base with shared read access and uploads a file
  • A regular user account exists (the attacker)

Obtaining the file UUID (attacker):

GET /api/v1/knowledge/{kb_id}/files

This returns metadata for all files in the KB, including their UUIDs.

Exploit (attacker):

bash
python3 poc_exploit.py --url http://<host>:3000 --file-id <target-file-uuid> -t <attacker-jwt>

The PoC script: poc_exploit.py

  1. Authenticates as the attacker
  2. Overwrites the target file via POST /api/v1/retrieval/process/files/batch with a canary payload containing a unique marker string
  3. Reads the file back and confirms the attacker's content replaced the original

Verifying RAG poisoning:

After the overwrite, log in as any other user, start a chat with the poisoned knowledge base attached, and ask about the document. The model's response will include the attacker's canary string (BOLA-<marker>), confirming that attacker-controlled content reached the LLM and influenced the response.

No special tooling is required. The script uses only Python 3 standard library (urllib).

Impact

Who is affected: Any multi-user Open WebUI deployment where knowledge bases are shared. The attacker needs a valid account (any role) and a target file UUID, which is available through any knowledge base they have read access to.

What can happen:

  • RAG poisoning: The overwritten content is served to the LLM via RAG. The attacker controls what the model tells every user who queries that knowledge base. This includes the ability to inject instructions the model will follow, which could lead to further exploitation depending on what tools and capabilities are available in the deployment (e.g. code interpreter, function calling).
  • Silent data corruption: The original file content is permanently replaced with no indication to the file owner or other users that it has changed.
  • No audit trail: Nothing records that an unauthorized user modified the file.

The core issue is that a function designed as an internal helper is exposed as a public endpoint without its own authorization checks. A user with read-only access to a knowledge base can escalate to write access over any file in it.

Disclaimer on the use of AI powered tools

The research and reporting related to this vulnerability was aided by the help of AI tools.

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Python (PyPI) open-webui < 0.8.6 0.8.6

Verweise

CVSS-Wert 7.1/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
Schwäche (CWE)
CWE-639
Plattform
Python (PyPI)
Paket
open-webui
Veröffentlicht
27.03.2026
Aktualisiert
11.10.2026 14:17

Quellen und Lizenzen

OSV / GitHub Advisory Database - PYSEC-2026-2742 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-jjp7-g2jw-wh3j - CC BY 4.0

Schwachstellenhistorie: open-webui

Alle veröffentlichten Schwachstellen dieses Pakets (Python (PyPI)), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (161) im Archiv
Einträge insgesamt
161
Erste → letzte
08.2024 09.2026
Ohne Fix
11
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 1
  • Hoch 77
  • Mittel 75
  • Niedrig 8

Veröffentlichungen pro Jahr

  1. 2024: 3
  2. 2025: 21
  3. 2026: 137
Schweregrad:
  1. Hoch · 7.7 CVE-2026-59221 >= 0.9.6, < 0.10.0 0.10.0
  2. Hoch · 7.3 CVE-2026-59214 < 0.10.0 0.10.0
  3. Hoch · 8.7 CVE-2026-54011 < 0.9.6 0.9.6
  4. Hoch · 7.1 CVE-2026-45349 < 0.9.0 0.9.0
  5. Hoch · 7.7 CVE-2026-45303 < 0.6.5 0.6.5
  6. Hoch · 7.1 CVE-2026-44569 < 0.6.19 0.6.19
  7. Hoch · 8.1 CVE-2026-44565 < 0.6.10 0.6.10
  8. Hoch · 7.3 CVE-2026-44566 < 0.1.124 0.1.124
  9. Hoch · 7.3 CVE-2026-44567 < 0.1.124 0.1.124
  10. Hoch · 7.3 CVE-2026-44549 < 0.8.0 0.8.0
  11. Kritisch · 9.1 CVE-2026-44551 < 0.9.0 0.9.0
  12. Hoch · 7.3 CVE-2026-44721 < 0.9.0 0.9.0
  13. Hoch · 7.7 CVE-2026-34222 < 0.8.11 0.8.11
  14. Open WebUI's process_files_batch() endpoint missing ownership check, allows unauthorized file overwrite dieser Eintrag
    Hoch · 7.1 CVE-2026-28788 < 0.8.6 0.8.6
  15. Hoch · 7.5 ghsa-5ccf-884p-4jjq <= 0.3.21 keine Korrektur
  16. Hoch · 8.4 CVE-2024-7990 <= 0.3.8 keine Korrektur
  17. Hoch · 8.0 CVE-2024-7806 < 0.3.33 0.3.33
  18. Hoch · 7.6 CVE-2024-7053 <= 0.3.8 keine Korrektur
  19. Hoch · 8.1 CVE-2024-7043 < 0.3.16 0.3.16
  20. Hoch · 7.5 CVE-2024-7036 <= 0.3.8 keine Korrektur
  21. Hoch · 7.5 ghsa-w466-2wfc-8g58 <= 0.3.32 keine Korrektur
  22. Hoch · 7.5 CVE-2024-12534 <= 0.3.32 keine Korrektur
  23. Hoch · 7.5 CVE-2024-12537 <= 0.3.32 keine Korrektur

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.