Open WebUI: Cross-user model-list exposure via static cache key in get_all_models (aiocache key= vs key_builder= misuse)
Summary
The get_all_models handlers in routers/openai.py and routers/ollama.py intended to cache their permission-filtered model lists per user, but the @cached decorator was misconfigured: it passed a key= lambda instead of key_builder=. In aiocache 0.12.3 (the pinned version), key= is a static cache key — a callable passed there is used as a constant object, not invoked per call. As a result the per-user key was never computed, and all callers collided onto a single shared cache entry within the TTL window. During that window, one user's permission-filtered model list could be served to a different authenticated user, crossing the per-user authorization boundary.
Impact
- Boundary crossed: Confidentiality (cross-user). A caller can receive the model list scoped to a different security principal than themselves.
- A user (or admin, or — depending on endpoint reachability — anonymous caller) who populates the cache causes the next caller within the TTL to receive that list rather than their own permission-filtered one.
- What's disclosed is the set of models another principal can access, including potentially the existence and naming of models restricted from the receiving user.
- Exposure is incidental and timing-dependent, not attacker-controlled: the leaked entry is whatever the most recent caller populated within
MODELS_CACHE_TTL(default 1 second), and the attacker cannot select the victim or force a target's list into the cache.
Affected component
backend/open_webui/routers/openai.py—get_all_models(~line 488)backend/open_webui/routers/ollama.py—get_all_models(~line 302)
Both decorated with @cached(ttl=MODELS_CACHE_TTL, key=lambda ...). No other @cached(... key=lambda ...) misuse was found elsewhere in the backend.
Root cause
aiocache 0.12's @cached treats key= as a static key; the per-call hook is key_builder= with signature key_builder(func, *args, **kwargs). Passing a callable to key= uses the callable object itself as a constant key, so every invocation resolved to the same entry and the intended per-user.id namespacing never occurred.
Reproduction (default config)
- On a default deployment, configure at least two users with different model-access permissions (e.g. one model restricted to user A).
- As user A, request the model list (populates the shared cache entry).
- Within
MODELS_CACHE_TTL(default 1s), as user B, request the model list. - User B receives user A's permission-filtered list, including models B is not permitted to see.
Remediation
Replace key= with key_builder= at both call sites and adjust the lambda to take the function as its first argument:
@cached(
ttl=MODELS_CACHE_TTL,
key_builder=lambda _func, request, user=None: (
f'openai_all_models_{user.id}' if user else 'openai_all_models'
),
)
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | open-webui | >= 0.6.27, < 0.10.0 | 0.10.0 |
References
- https://github.com/open-webui/open-webui/security/advisories/GHSA-3wp3-xxj9-5jqq
- https://nvd.nist.gov/vuln/detail/CVE-2026-59213
- https://github.com/open-webui/open-webui/pull/25783
- https://github.com/open-webui/open-webui/commit/0fc630b34b2899599dabffffa012afd47599aa75
- https://github.com/open-webui/open-webui
- https://github.com/open-webui/open-webui/releases/tag/v0.10.0
- https://pypi.org/project/open-webui
- https://github.com/advisories/GHSA-3wp3-xxj9-5jqq
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N- Weakness (CWE)
CWE-524- Platform
- Python (PyPI)
- Package
open-webui- Disclosed
- 24.07.2026
- Updated
- 11.10.2026 14:19
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2026-3589 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-3wp3-xxj9-5jqq - CC BY 4.0
Vulnerability history: open-webui
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 161
- First → latest
- 08.2024 09.2026
- Without a fix
- 11
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 77
- Medium 75
- Low 8
Disclosures per year
- 2024: 3
- 2025: 21
- 2026: 137
-
Open WebUI: Cross-user model-list exposure via static cache key in get_all_models (aiocache key= vs key_builder= misuse) this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.