CVE-2026-54021: Open WebUI: Authenticated users can target arbitrary configured Ollama backends via unguarded url_idx path parameter
Open WebUI 0.9.5 and earlier lets any authenticated user pick which Ollama backend serves their request by adding a url_idx to the path. The index is used raw against OLLAMA_BASE_URLS, so a normal user can reach internal, higher-privilege or admin-disabled backends, which run with that backend's own API key. Fixed in 0.9.6.
Published Jun 17, 2026 · Updated Jul 20, 2026 · Analysis Nov 2, 2026
What an attacker can do
In backend/open_webui/routers/ollama.py, get_ollama_url() looks up the model-to-backend allow-list only when url_idx is omitted. If the caller supplies url_idx, the value indexes straight into OLLAMA_BASE_URLS. Access control checks that the user may use the model, never which backend receives the request. Eight indexed routes are exposed, including POST /ollama/api/chat/{url_idx}, /ollama/api/generate/{url_idx}, /ollama/api/embed/{url_idx} and the /ollama/v1/chat/completions/{url_idx} family.
The request leaves the server carrying the target backend's configured API key. Backends an admin disabled through OLLAMA_API_CONFIGS stay hidden from model discovery, yet remain reachable by index because the disabled flag is not re-checked at request time.
The attacker needs only a verified non-admin account with read access to one model. In multi-backend deployments they can bypass isolation between, for example, a public GPU pool and a restricted internal one, and spend the restricted backend's compute. The advisory states there is no cross-user data disclosure and the backend key is not returned to the attacker.
Who is affected
The pip package open-webui at 0.9.5 and earlier. The risk is greatest when OLLAMA_BASE_URLS lists more than one backend, or when an admin has disabled a backend. Check:
pip show open-webuiThen review OLLAMA_BASE_URLS and the per-backend enable flags in the admin connection settings.
open-webui
- Ecosystem
- PyPI
- Affected
- <= 0.9.5
- Fixed in
- 0.9.6
- Check
pip show open-webui
How to fix it
Upgrade open-webui to 0.9.6:
pip install --upgrade open-webui==0.9.6Version 0.9.6 adds validate_ollama_backend_idx(), called on every indexed route. It returns 403 when a non-admin caller supplies a url_idx outside the requested model's allowed urls. Disabled backends appear in no model's urls, so the same check blocks them. The advisory gives no workaround. Until you upgrade, a reverse proxy rule that blocks paths ending in a numeric index under /ollama/ for non-admin traffic is an option, though the advisory does not suggest it.
How to tell if you were hit
Search access logs for requests to /ollama/api/chat/, /ollama/api/generate/, /ollama/api/embed/ and the /ollama/v1/ routes that end in a number, from non-admin accounts. Compare against what your clients normally call. On the Ollama side, look for traffic or GPU usage on a backend that should be disabled or restricted, coming from the Open WebUI host.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
Several direct, index-addressed Ollama proxy routes accept a caller-supplied url_idx path parameter and use it as a raw index into the admin-configured OLLAMA_BASE_URLS list. Access control on these routes validates only whether the user may use the requested *model*, never which *backend* the request is routed to. Any authenticated user can append an arbitrary url_idx to force their request onto an Ollama backend they were never authorized to reach, including internal, higher-privilege, or explicitly admin-disabled backends.
Affected endpoints
All indexed Ollama routes that resolve the backend through get_ollama_url():
POST /ollama/api/chat/{url_idx}
POST /ollama/api/generate/{url_idx}
POST /ollama/api/embed/{url_idx}
POST /ollama/api/embeddings/{url_idx}
POST /ollama/v1/chat/completions/{url_idx}
POST /ollama/v1/completions/{url_idx}
POST /ollama/v1/messages/{url_idx}
POST /ollama/v1/responses/{url_idx}Root cause
backend/open_webui/routers/ollama.py — get_ollama_url() consults the model-to-backend allow-list (OLLAMA_MODELS[model]["urls"]) only when url_idx is omitted. When the caller supplies url_idx, that mapping is skipped and the value is used directly as an index:
async def get_ollama_url(request: Request, model: str, url_idx: Optional[int] = None):
if url_idx is None:
models = request.app.state.OLLAMA_MODELS
if model not in models:
raise HTTPException(...)
url_idx = random.choice(models[model].get("urls", []))
url = request.app.state.config.OLLAMA_BASE_URLS[url_idx] # caller-controlled, no authz
return url, url_idxThe outbound request is then sent to that backend using the backend's own configured API key. Backends an admin has disabled (OLLAMA_API_CONFIGS["<idx>"].enable = false) are hidden from model discovery but remain reachable through the indexed route, because the disabled state is never re-checked at request time.
Impact
A verified, non-admin user with read access to any single model can:
- route requests to internal / higher-capability / restricted Ollama backends in multi-backend deployments, bypassing backend-level isolation;
- reach backends the admin has explicitly disabled;
- have those requests authenticated with the target backend's configured API key (the key is used server-side; it is not returned to the attacker);
- consume the restricted backend's compute.
There is no cross-user data disclosure and no exfiltration of the backend credential itself; the impact is unauthorized access to, and use of, restricted backend resources.
Affected / Patched
- Affected:
<= 0.9.5 - Patched:
>= 0.9.6
Fix
0.9.6 adds validate_ollama_backend_idx(), invoked on every indexed route (directly and via get_ollama_url()), which returns 403 for any non-admin caller-supplied url_idx that is not in the requested model's allowed urls. Because disabled backends are absent from every model's urls, the same check also blocks routing to disabled backends.
Credited to brodmart, Classic298.
Questions
- Does the attacker see the backend's API key?
No. The advisory says the key is used server-side and is not returned. The attacker gets unauthorized use of the backend, not its credential.
- Does this affect single-backend setups?
Much less. The gain is reaching a different backend than you were authorized for. With one backend, there is little to switch to, unless it was disabled.
- Can a user read other users' data through this?
The advisory says no cross-user data disclosure occurs. The impact is access to and use of restricted backend resources.
- Is it exploited in the wild?
The sources do not say so, and the entry has no CISA catalog data.
References
Read for this analysis:
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Open WebUI vulnerabilities
All Open WebUI entriesCVE-2026-87011
Open WebUI: Unauthenticated requests can stall the server via uncached OIDC fetches in back-channel logout
high7.5Sep 10, 2026CVE-2026-87012
Open WebUI: Any authenticated user can suppress calendar alerts instance-wide via a non-numeric alert value
medium4.3Sep 10, 2026CVE-2026-87013
Open WebUI: Any authenticated user can start a non-terminating request via a folder parent cycle
medium4.3Sep 10, 2026CVE-2026-87014
Open WebUI: Admin demoted through SSO role sync keeps read and write access to all users' notes
medium6.5Sep 10, 2026CVE-2026-87015
Open WebUI: A user's session cookies are sent to tool servers configured for bearer authentication
medium6.8Sep 10, 2026CVE-2026-87016
Open WebUI: Sign-in as another user via wildcard characters in the OAuth subject claim on SQLite
high8.1Sep 10, 2026
