fix: preserve RAG upload limits and block unsafe iframes - #23
Draft
cursor[bot] wants to merge 8 commits into
Draft
cursor[bot] wants to merge 8 commits into
cursor[bot] wants to merge 8 commits into
Conversation
Co-authored-by: mkatwi <mkatwi@users.noreply.github.com>
Co-authored-by: mkatwi <mkatwi@users.noreply.github.com>
Co-authored-by: mkatwi <mkatwi@users.noreply.github.com>
Co-authored-by: mkatwi <mkatwi@users.noreply.github.com>
Co-authored-by: mkatwi <mkatwi@users.noreply.github.com>
Co-authored-by: mkatwi <mkatwi@users.noreply.github.com>
Co-authored-by: mkatwi <mkatwi@users.noreply.github.com>
Co-authored-by: mkatwi <mkatwi@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
Before submitting, make sure you've checked the following:
mainper run configuration.fix:.Changelog Entry
Description
srcvalues.Added
getSafeIframeSrcutility and Vitest coverage for external, same-origin, backend-origin, and script/data/file iframe sources.Changed
/api/v1/retrieval/config/updatenow treats omitted nullable upload/compression fields consistently with the surrounding optional config fields.srcbefore creating an iframe.Deprecated
Removed
Fixed
FILE_MAX_SIZE,FILE_MAX_COUNT,FILE_IMAGE_COMPRESSION_WIDTH, orFILE_IMAGE_COMPRESSION_HEIGHT./api/v1/auths/signout, or script/data/file schemes.Security
Breaking Changes
Additional Information
Bug and impact:
{ web: ... }) overwrote upload limits and image compression settings withNone, disabling admin-enforced upload controls.srcvalues, allowing authenticated same-origin GET side effects from viewed chat content.Root cause:
form_datainstead of preserving existing values when omitted.HTMLToken.svelteextracted iframe URLs from unsanitizedtoken.textand rendered them without origin/scheme validation.Fix and validation performed:
Nonepreservation for the four RAG upload/compression fields.python3 -m py_compile backend/open_webui/routers/retrieval.py tests/test_rag_config_update.py.test_partial_rag_updates_preserve_file_upload_settings()becausepytestis unavailable in the base image.npm cito install pinned frontend dependencies.npx vitest run src/lib/utils/iframe.test.ts(4 tests passed).npx prettier --check src/lib/components/chat/Messages/Markdown/HTMLToken.svelte src/lib/utils/iframe.ts src/lib/utils/iframe.test.ts.git diff --check origin/main..HEAD.Screenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree with the Contributor License Agreement (CLA), and I am providing my contributions under its terms.