Files
open-webui/backend/open_webui/routers
Classic298anddestination-one c66c273f62 fix: strip model params for read-only callers on per-id endpoint (#24525)
GET /api/v1/models/model?id=<model_id> at routers/models.py:412
returned the full model.model_dump() to any caller with read access,
including the params dict that holds the admin-curated system prompt
and other behavior config. The user-facing /api/models endpoint
already strips this via utils/models.py:170,210 with the comment
"Remove params to avoid exposing sensitive info", and /api/v1/models/list
gates by write permission so non-curators don't see the model in their
workspace listing at all. The per-id endpoint missed the same gate, so
a user with read-only access (e.g. granted access to use the model in
chat) could open /workspace/models/edit?id=<not-mine> in the browser
and read the system prompt verbatim from the network response, even
though saving was correctly blocked.

Compute write_access once at the top of the handler so it can serve
both the response-shape decision and the response field. When the
caller lacks write access, replace params with an empty dict in the
serialised response. Owners, admins under BYPASS_ADMIN_ACCESS_CONTROL,
and explicit write-grant holders still get the full payload so the
workspace edit UI keeps working for users who legitimately curate the
model.

Read-permission users continue to receive everything else they need to
chat with the model — the chat path resolves prompt/params server-side
from the stored ModelModel and never echoes them back through this
endpoint.

Reported by destination-one in GHSA-h2cw-7qw9-56xr.

Co-authored-by: destination-one <destination-one@users.noreply.github.com>
2026-05-11 00:59:08 +09:00
..
2026-04-12 18:12:59 -05:00
2026-05-09 15:25:27 +09:00
2026-04-21 13:46:39 +09:00
2026-04-21 15:41:07 +09:00
2026-05-09 08:28:29 +09:00
2026-05-09 15:25:27 +09:00
2026-04-12 18:12:59 -05:00
2026-04-12 18:12:59 -05:00
2026-04-21 15:52:00 +09:00
2026-04-12 14:22:11 -05:00
2026-05-09 21:07:08 +09:00
2026-04-19 22:45:54 +09:00
2026-04-17 14:28:18 +09:00
2026-05-09 04:17:58 +09:00
2026-05-09 15:25:27 +09:00
2026-04-20 08:53:06 +09:00
2026-04-12 14:22:11 -05:00
2026-05-09 05:14:55 +09:00
2026-04-20 08:36:24 +09:00
2026-04-24 18:48:21 +09:00
2026-04-13 14:08:58 -05:00