---
title: "Open WebUI’s image-prompt task route ignores the switch and the permission its sibling routes enforce"
slug: open-webui-image-prompt-task-route
draft: false
date: "2026-11-24"
datetime: "2026-11-24T06:36:19Z"
updated: "2026-11-24"
description: "With image-prompt generation off and the account denied image-generation permission, Open WebUI’s task route still calls the operator’s model provider. The direct image route returns 403."
abstract: >-
  Open WebUI documents ENABLE_IMAGE_PROMPT_GENERATION as the control that turns image-prompt generation off. The chat middleware honours it; the HTTP route that performs the same generation, POST /api/v1/tasks/image_prompt/completions, checks neither the switch nor the caller’s features.image_generation permission. It resolves the configured task model and sends the completion with the operator’s provider credential. We ran the released v0.13.3 image with the switch off, every other task switch off, and a regular account denied image-generation permission: the task route returned 200 and the stub provider logged the call, while the direct image route returned 403 and the title route returned its disabled message without a provider call. Every sibling task route on the same router applies its switch; this one is the exception. The same router’s query route also reads its switches only inside the named type branches, so a request with no type reaches the task model.
authors:
  - name: EZO Labs Security
    url: https://ezolabs.net
section: environments
report_number: EZO-R-2026-16
lang: en
og:
  kicker: "EZO LABS // SECURITY"
  title:
    - "Open WebUI’s image-prompt"
    - "task route ignores the"
    - "switch and the permission"
  foot:
    - "An independent write-up."
    - "Notes from the disclosure."
bibtex_key: openwebuiimageprompttaskroute
revisions:
  - date: "2026-11-24"
    note: "First publication."
license: cc-by-4.0
---

## Summary

The administrator has two controls for image prompts: a global switch and a per-user permission. The chat path honours both. The task route honours neither.

## The gap

The image-prompt task route dispatches a billable completion against the operator’s provider credential without reading the administrator’s image-prompt switch or the caller’s image-generation permission, while the direct image route refuses the same account with 403.

- `backend/open_webui/routers/tasks.py:348-349`: `POST /api/v1/tasks/image_prompt/completions` checks neither the `ENABLE_IMAGE_PROMPT_GENERATION` switch (`image_generation.prompt.enable`) nor the caller’s `features.image_generation`; after `Depends(get_verified_user)` it goes straight to model resolution.
- `backend/open_webui/utils/middleware.py:1582`: The chat middleware honours the switch (`if await Config.get('image_generation.prompt.enable'):` before `generate_image_prompt`), which shows the intended gate exists.
- `backend/open_webui/routers/images.py:585-596, 885-897`: The direct image routes reject with 403 when `ENABLE_IMAGE_GENERATION` is off or the caller lacks `features.image_generation`.
- `backend/open_webui/routers/tasks.py:143, 218, 285, 411, 417, 485`: Every sibling task route applies its switch before dispatch; the image-prompt route is the only task route with a switch of its own and no check. The query route also reads `task.query.search.enable`/`task.query.retrieval.enable` only inside the named `type` branches, so a request with no `type` passes both.

## Reproduction

The released image was started with `ENABLE_IMAGE_PROMPT_GENERATION=false`, every other task switch off, `ENABLE_IMAGE_GENERATION=true`, and an OpenAI-compatible stub that logs every request body; a regular account had `features.image_generation` denied.

`POST /api/v1/tasks/image_prompt/completions` returns 200 with a chat-completion object carrying the generated prompt, and the stub logs the provider call (bytes=876, body with the image-prompt task template). In the same run `POST /api/v1/images/generations` returns 403 for the same account, and `POST /api/v1/tasks/title/completions` returns 200 `{"detail":"Title generation is disabled"}` with no provider call. A `POST /api/v1/tasks/queries/completions` with no `type` reaches the task model; the same request with `type: web_search` returns 400.

## Impact

Every verified account can make the server send an image-prompt completion to the operator’s configured task model after the administrator turns ENABLE_IMAGE_PROMPT_GENERATION off, and even when the administrator has denied that account features.image_generation. The request is billed to the operator’s credential, has no rate limit, and its input size is caller-controlled, so one account can exhaust the task model’s quota (denial of wallet).

## Affected versions

Open WebUI v0.13.3, the release we ran, and v0.13.4 (current release, published 2026-11-17), whose image-prompt route still reads neither control; `main` carries the same code as v0.13.4. Line numbers in this note are v0.13.3’s; in v0.13.4 the route sits at `routers/tasks.py:331-352` and the middleware check at `utils/middleware.py:1600`. The image-prompt route is the public HTTP surface for the generation; the Svelte frontend calls the middleware in-process instead.

## Fix status

Add a guard before model resolution in `generate_image_prompt` (`routers/tasks.py:349`), matching the middleware’s switch check at `utils/middleware.py:1582`, plus the `features.image_generation` check `routers/images.py` uses. Apply the matching switch in `generate_queries` (`routers/tasks.py:408`) for a request with no `type`.

## The vendor’s record

No maintainer reply. Two published advisories establish the class on other surfaces (`GHSA-rqj7-6wrp-6g2g`, `GHSA-g423-grf7-98rv`); neither covers this route. The chat middleware’s own check is the vendor’s design statement that the switch gates this generation.

## Timeline

- 2026-11-09T05:19:21Z: Private report filed (`GHSA-8x5h-c3vm-xj52`)
- 2026-11-12: Notice naming 2026-11-17T16:00Z as the planned publication
- 2026-11-24T06:36:19Z: This write-up published
- 2026-11-24: MITRE CNA-LR request submitted

## References

- POST /api/v1/images/edit bypasses the global image-edit switch and the per-user image-generation permission: https://github.com/open-webui/open-webui/security/advisories/GHSA-rqj7-6wrp-6g2g
- Users denied the image-generation permission can still generate images via chat completions: https://github.com/open-webui/open-webui/security/advisories/GHSA-g423-grf7-98rv
- Private report: https://github.com/open-webui/open-webui/security/advisories/GHSA-8x5h-c3vm-xj52

## Disclosure

This note is an independent write-up. It is published on 2026-11-24 as the public reference for a CVE request. The private advisory and this write-up describe the same defect; the vendor advisory named above is the authority where one exists.
