[PR #23648] [MERGED] fix: drop extra='allow' on FolderForm and FolderUpdateForm #42930

Closed
opened 2026-04-25 14:41:34 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/23648
Author: @Classic298
Created: 4/12/2026
Status: Merged
Merged: 4/13/2026
Merged by: @tjbck

Base: devHead: fix/folder-form-mass-assignment


📝 Commits (2)

  • c0847d3 fix: drop extra='allow' on FolderForm and FolderUpdateForm
  • 27f1b53 fix: reject unknown fields on FolderForm and FolderUpdateForm

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 backend/open_webui/models/folders.py (+2 -2)

📄 Description

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.

Contributor License Agreement

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/23648 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 4/12/2026 **Status:** ✅ Merged **Merged:** 4/13/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix/folder-form-mass-assignment` --- ### 📝 Commits (2) - [`c0847d3`](https://github.com/open-webui/open-webui/commit/c0847d34fd5410c2c44759506bdd2bb6db78a771) fix: drop extra='allow' on FolderForm and FolderUpdateForm - [`27f1b53`](https://github.com/open-webui/open-webui/commit/27f1b539da32e16a3b7d05e433e64f8e02cac9a2) fix: reject unknown fields on FolderForm and FolderUpdateForm ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/models/folders.py` (+2 -2) </details> ### 📄 Description 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. ### Contributor License Agreement <!-- 🚨 DO NOT DELETE THE TEXT BELOW 🚨 Keep the "Contributor License Agreement" confirmation text intact. Deleting it will trigger the CLA-Bot to INVALIDATE your PR. Your PR will NOT be reviewed or merged until you check the box below confirming that you have read and agree to the terms of the CLA. --> - [X] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 14:41:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#42930