open-webui/backend/open_webui
Classic298 8979987eed
fix: drop extra='allow' on FolderForm and FolderUpdateForm (#23648)
* fix: drop extra='allow' on FolderForm and FolderUpdateForm

These request models were configured to accept arbitrary extra fields,
which were then merged into the folder row via form_data.model_dump().
In insert_new_folder the server-assigned user_id is placed before the
form spread, so a client-supplied user_id in the request body would
override it and the folder would be persisted against another account.

Strictly typed inputs are the correct shape for these endpoints — the
client has no legitimate reason to send fields beyond the declared
ones, and dropping extra='allow' closes the mass-assignment sink at
the validation layer instead of relying on every callsite to merge
fields in the right order.

* fix: reject unknown fields on FolderForm and FolderUpdateForm

Address review feedback: dropping extra='allow' fell back to Pydantic
v2's default extra='ignore', which only silently drops unknown fields
instead of rejecting them. The intent for these request models is a
strict input contract — fail fast when a client sends anything the
server does not expect — so explicitly set extra='forbid'. This also
makes the hardening visible in the form definition rather than implicit
in the default.
2026-04-13 16:14:00 -05:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal refac 2026-04-12 19:41:02 -05:00
migrations refac 2026-04-01 18:26:46 -05:00
models fix: drop extra='allow' on FolderForm and FolderUpdateForm (#23648) 2026-04-13 16:14:00 -05:00
retrieval refac 2026-04-13 16:03:36 -05:00
routers refac 2026-04-13 14:33:23 -05:00
socket fix: invalidate stale Socket.IO sessions on role change and user deletion (#23642) 2026-04-12 16:19:38 -05:00
static refac 2026-03-23 23:39:52 -05:00
storage refac 2026-04-12 19:08:30 -05:00
test refac 2026-03-17 17:58:01 -05:00
tools chore: format 2026-04-12 22:11:10 -05:00
utils refac 2026-04-13 15:13:14 -05:00
__init__.py refac (#22987) 2026-03-24 15:41:26 -05:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py refac 2026-04-13 13:44:44 -05:00
constants.py refac 2026-04-13 14:08:58 -05:00
env.py chore: format 2026-04-12 18:12:59 -05:00
functions.py refac: async db 2026-04-12 14:22:11 -05:00
main.py refac 2026-04-13 15:14:55 -05:00
tasks.py refac 2026-03-17 17:58:01 -05:00