You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes a security issue where any Firefox extension (moz-extension://.*) could access the ActivityWatch server without any restriction.
Previously, the CORS configuration included a wildcard for all Mozilla extensions by default. This commit removes that blanket permission and introduces granular control through both static configuration and the Web UI.
We've added 2 new fields to the file configuration (cors_allow_aw_chrome_extension and cors_allow_all_mozilla_extension) and 4 new settings to the Web UI (Fixed origins, Regex origins, and extension-specific shortcuts). The server now merges these settings to determine the final set of authorized origins, ensuring a more secure and flexible configuration.
The TOML configuration file values are now used only as an initial seed for the database during the first run. On subsequent runs, any values changed and persisted via the Web UI will take precedence over the config file defaults.
Fixed a bug in the web-ui store where changing one setting would cause all other settings to be re-saved with their initial client-side values, unintentionally overwriting database settings with stale defaults.
Dependent on: ActivityWatch/aw-webui#795
# Allow official ActivityWatch Chrome extension? (default: true)
65
+
#cors_allow_aw_chrome_extension = true
66
+
67
+
# Allow all Firefox extensions? (default: false, DANGEROUS)
68
+
#cors_allow_all_mozilla_extension = false
63
69
```
64
70
71
+
#### Persistence and Settings UI
72
+
73
+
The CORS-related settings (`cors`, `cors_regex`, `cors_allow_aw_chrome_extension`, and `cors_allow_all_mozilla_extension`) follow a specific persistence logic:
74
+
75
+
-**First Start**: These variables are only taken into account on the first server start, at which point they are added to the database.
76
+
-**Management**: Once added, they can be managed and edited via the **Settings UI** in the web interface.
77
+
-**Precedence**: Values in the database take precedence over the configuration file on subsequent starts.
78
+
-**Warning**: If these keys are deleted from the database, the server will again use the values from the configuration file to re-populate them. This ensures that the fields are always present, either from your manual settings or your initial configuration.
79
+
65
80
#### Custom CORS Origins
66
81
67
82
By default, the server allows requests from:
68
83
- The server's own origin (`http://127.0.0.1:<port>`, `http://localhost:<port>`)
69
-
- The official Chrome extension (`chrome-extension://nglaklhklhcoonedhgnpgddginnjdadi`)
70
-
- All Firefox extensions (`moz-extension://.*`)
84
+
- The official Chrome extension (`chrome-extension://nglaklhklhcoonedhgnpgddginnjdadi`) if `cors_allow_aw_chrome_extension` is true (default).
85
+
- All Firefox extensions (`moz-extension://.*`) ONLY IF `cors_allow_all_mozilla_extension` is set to true.
71
86
72
-
To allow additional origins (e.g. a sideloaded Chrome extension), add them to your config:
87
+
To allow additional origins (e.g. a sideloaded Chrome extension), add them to your `cors` or `cors_regex`config:
0 commit comments