CVE-2026-45402: Open WebUI: Cross-User File Access via Unchecked file_id in Folder Knowledge and Knowledge-Base Attach Endpoints

Published May 14, 2026
·
Updated

Cross-User File Access via Unchecked fileid in Folder Knowledge and Knowledge-Base Attach Endpoints

Summary

Multiple endpoints accept a user-supplied fileid and attach the referenced file to a resource the caller controls (folder knowledge, knowledge-base contents) without verifying that the caller owns or has been granted access to the file. The file's content then becomes reachable through the downstream RAG / file-content paths, allowing any authenticated user to exfiltrate any other user's private file — and on the knowledge-base path, also to overwrite it — given knowledge of the file's UUID.

Affected code paths

Path 1 — Folder knowledge ingestion via folders.update

backend/openwebui/routers/folders.py:156 — POST /api/v1/folders/{id}/update accepts a FolderUpdateForm whose data: Optional[dict] field is written verbatim into the folder. The folder consumer at backend/openwebui/utils/middleware.py:2409 spreads folder.data['files'] directly into formdata['files'] for the next chat completion, which becomes RAG context. There is no per-file ownership check at the writer (the update handler) and no per-file ownership check at the reader (the middleware folder consumer) — only the folder list endpoint (folders.py:78-94) cleans up by stripping inaccessible files, and that runs lazily at folder-list time rather than at chat time. An attacker with a victim's file UUID can write data: {"files": [{"id": "<victim>", "type": "file"}]} into their own folder, immediately chat in that folder, and have the LLM return the victim's document content via RAG. The cleanup pass strips the file from persistence later, but the exfiltration has already happened.

Path 2 — Knowledge-base attach via knowledge.{id}/file/add and knowledge.{id}/files/batch/add

backend/openwebui/routers/knowledge.py:616-669 (addfiletoknowledgebyid) and backend/openwebui/routers/knowledge.py:972-1035 (addfilestoknowledgebyidbatch) check the caller's write access to the knowledge base but never validate the caller's access to the fileid being attached. Because hasaccesstofile(..., user) returns True for any file linked to a KB the caller owns, attaching a victim's fileid to an attacker-owned KB silently unlocks read and write on that file through /api/v1/files/{id}/content and /api/v1/files/{id}/data/content/update. This is a stronger variant than Path 1 — full read AND overwrite, persisted, no cleanup pass to mitigate.

Proof of concept

Path 1 (folder knowledge) bash Attacker writes victim fileid into their own folder curl -X POST http://target/api/v1/folders/<attackerfolderid>/update \ -H "Authorization: Bearer $ATK" -H "Content-Type: application/json" \ -d "{\"data\": {\"files\": [{\"id\": \"$VICTIMFILEID\", \"type\": \"file\"}]}}"

Attacker chats in that folder — victim file becomes RAG context curl -X POST http://target/api/chat/completions \ -H "Authorization: Bearer $ATK" -H "Content-Type: application/json" \ -d "{\"model\":\"any\",\"messages\":[{\"role\":\"user\",\"content\":\"summarise my uploaded document\"}],\"folderid\":\"<attackerfolderid>\"}" Path 2 (knowledge-base attach)

Attacker creates own KB KB=$(curl -s -X POST http://target/api/v1/knowledge/create \ -H "Authorization: Bearer $ATK" -H "Content-Type: application/json" \ -d '{"name":"x","description":"x","data":{}}' | jq -r .id)

Attach victim's fileid — no ownership check curl -X POST http://target/api/v1/knowledge/$KB/file/add \ -H "Authorization: Bearer $ATK" -H "Content-Type: application/json" \ -d "{\"fileid\":\"$VICTIMFILEID\"}"

Read victim file through standard files endpoint (now accessible because file is "linked to KB I own") curl http://target/api/v1/files/$VICTIMFILEID/content -H "Authorization: Bearer $ATK"

Overwrite curl -X POST http://target/api/v1/files/$VICTIMFILEID/data/content/update \ -H "Authorization: Bearer $ATK" -H "Content-Type: application/json" \ -d '{"content":"tampered"}'

Impact

- Confidentiality: Any authenticated user can read the contents of any other user's private uploaded file, given knowledge of the file UUID. UUIDs are V4 (not enumerable in practice) but leak through normal usage — file IDs appear in chat sources, in shared chats' citations, in URL paths (/workspace/files/<id>), in browser history / referrer headers, and in any export/share flow that surfaces source metadata. - Integrity: Path 2 (knowledge attach) additionally allows the attacker to overwrite the victim's file content, persisting attacker-controlled text under the victim's fileid. Subsequent reads by the victim or by any RAG flow that ingests the victim's file return the tampered content. - Availability: None directly — file rows are not deleted by these paths.

Recommended fix

Validate the supplied fileid against the caller's read access before attaching, in every writer.

Credits

Per the consolidation rule in SECURITY.md, credit goes only to reporters who FIRST identified a distinct sub-path that no earlier filing covered.

MrBeard-FT — first to identify the folder-knowledge ingestion path (Path 1) Classic298 — first to identify the knowledge-base attach path (Path 2 — /knowledge/{id}/file/add and /files/batch/add)

Other sources

Open WebUI is a self-hosted artificial intelligence platform designed to operate entirely offline. Prior to 0.9.5, multiple endpoints accept a user-supplied fileid and attach the referenced file to a resource the caller controls (folder knowledge, knowledge-base contents) without verifying that the caller owns or has been granted access to the file. The file's content then becomes reachable through the downstream RAG / file-content paths, allowing any authenticated user to exfiltrate any other user's private file — and on the knowledge-base path, also to overwrite it — given knowledge of the file's UUID. This affects backend/openwebui/routers/folders.py (POST /api/v1/folders/{id}/update), backend/openwebui/routers/knowledge.py (addfiletoknowledgebyid), and backend/openwebui/routers/knowledge.py (addfilestoknowledgebyidbatch). This vulnerability is fixed in 0.9.5.

MITRE

Affected Software

2 affected componentsFixes available
pip/open-webui<=0.9.4
0.9.5
openwebui Open WebUI<0.9.5

Event History

May 14, 2026
Advisory Published
via GitHub·08:27 PM
Data Sourced
via GitHub·08:27 PM
DescriptionSeverityWeaknessAffected Software
May 15, 2026
CVE Published
via MITRE·08:40 PM
Data Sourced
via MITRE·08:40 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-45402?

The severity of CVE-2026-45402 is rated high with a CVSS score of 8.1.

2

How do I fix CVE-2026-45402?

To fix CVE-2026-45402, ensure that proper access controls and validation are implemented for user-supplied `file_id` parameters.

3

What are the affected software versions for CVE-2026-45402?

CVE-2026-45402 affects Open WebUI versions prior to the security update included in version 0.9.5.

4

What type of vulnerability is CVE-2026-45402?

CVE-2026-45402 is a cross-user file access vulnerability due to unchecked file_id parameters.

5

What is the risk associated with CVE-2026-45402?

CVE-2026-45402 has a risk score of 60, indicating a significant threat to systems using the affected endpoints.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203