[SEC] restrict CORS to authorized extension IDs and migrate settings#2
Open
RaoufGhrissi wants to merge 2 commits intomasterfrom
Open
[SEC] restrict CORS to authorized extension IDs and migrate settings#2RaoufGhrissi wants to merge 2 commits intomasterfrom
RaoufGhrissi wants to merge 2 commits intomasterfrom
Conversation
Problem: Settings changes (UI preferences, startOfWeek) were being lost on server shutdown because they were waiting for a 15-second background commit timer. Solution: Ensure that SetKeyValue and DeleteKeyValue commands set self.commit = true in the datastore worker, forcing immediate persistence. Steps to Reproduce: 1. Start aw-server-rust. 2. Change a setting (e.g. startOfWeek). 3. Immediately kill the server: pkill -TERM aw-server. 4. Restart and check the setting.
332ca11 to
eb367e7
Compare
Problem: 1. Security: Firefox extensions had a blanket wildcard permission (moz-extension://.*). 2. Bug: CORS settings were stored in the general 'settings.' namespace (settings.cors_origins), which would overwrite values from config.toml and didn't support regex properly (causing panics if regex was used). Solution: 1. Restricted CORS to authorized extension IDs and introduced a dedicated 'cors-config' API and 'cors.' namespace in the datastore. 2. Implemented a migration script that moves existing 'settings.cors_origins' values to 'cors.cors' on startup. 3. Updated the CORS middleware to handle multiple origin sources (TOML, datastore exact/regex matches, and extension shortcuts). 4. Ensured that fields defined in config.toml are respected and non-editable through the UI, preventing accidental overwrites. 5. Added validation for regex patterns to prevent server panics. Refactored the backend to use a dedicated CORS configuration model, allowing granular control over security settings. Related PRs: https://github.com/odoo/aw-webui/pull/2/changes
eb367e7 to
8f7cafc
Compare
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.
[SEC] restrict CORS to authorized extension IDs and migrate settings
Problem:
Solution:
Refactored the Web UI to use a dedicated CORS configuration modal and store, providing granular control over security settings.
Related PRs: https://github.com/odoo/aw-webui/pull/2/changes