open-webui/backend/open_webui/utils
Classic298 83024d00bb
fix: enforce API key endpoint restrictions at the auth layer, not middleware (#23637)
The APIKeyRestrictionMiddleware only inspected the Authorization header for sk- tokens, but get_current_user also reads API keys from cookies and x-api-key headers. This allowed complete bypass of endpoint restrictions by sending the key via an alternate transport.

Moves the restriction check into get_current_user_by_api_key so it runs regardless of how the API key was delivered. Removes the now-redundant middleware.
2026-04-12 16:33:41 -05:00
..
access_control refac: async db 2026-04-12 14:22:11 -05:00
images refac 2026-03-17 17:58:01 -05:00
mcp refac: async db 2026-04-12 14:22:11 -05:00
telemetry refac: async db 2026-04-12 14:22:11 -05:00
actions.py refac: async db 2026-04-12 14:22:11 -05:00
anthropic.py refac 2026-03-17 17:58:01 -05:00
audit.py refac 2026-04-12 16:25:01 -05:00
auth.py fix: enforce API key endpoint restrictions at the auth layer, not middleware (#23637) 2026-04-12 16:33:41 -05:00
automations.py refac: async db 2026-04-12 14:22:11 -05:00
channels.py refac 2026-03-17 17:58:01 -05:00
chat.py refac: async db 2026-04-12 14:22:11 -05:00
code_interpreter.py refac 2026-03-17 17:58:01 -05:00
embeddings.py refac: async db 2026-04-12 14:22:11 -05:00
files.py refac: async db 2026-04-12 14:22:11 -05:00
filter.py refac: async db 2026-04-12 14:22:11 -05:00
groups.py refac: async db 2026-04-12 14:22:11 -05:00
headers.py refac 2026-03-17 17:58:01 -05:00
logger.py refac 2026-04-10 10:15:55 -07:00
middleware.py refac: async db 2026-04-12 14:22:11 -05:00
misc.py perf: single yield per line in stream chunks handler (#23266) 2026-03-31 18:42:52 -05:00
models.py refac: async db 2026-04-12 14:22:11 -05:00
oauth.py refac: async db 2026-04-12 14:22:11 -05:00
payload.py refac 2026-03-24 04:49:48 -05:00
pdf_generator.py refac 2026-03-17 17:58:01 -05:00
plugin.py refac: async db 2026-04-12 14:22:11 -05:00
rate_limit.py refac 2026-03-17 17:58:01 -05:00
redis.py refac: async db 2026-04-12 14:22:11 -05:00
response.py refac 2026-03-24 04:49:48 -05:00
sanitize.py refac 2026-03-17 17:58:01 -05:00
security_headers.py refac 2026-03-17 17:58:01 -05:00
task.py fix: Fix the error that occurs when the task model does not exist (#23169) 2026-04-01 07:01:25 -05:00
tools.py refac: async db 2026-04-12 14:22:11 -05:00
validate.py chore: format 2026-04-02 08:11:06 -05:00
webhook.py refac 2026-03-24 04:49:48 -05:00