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 (allow_aw_chrome_extension and 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.
Dependent on: ActivityWatch/aw-webui#795
edited according to the last changes
# 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 precedence logic between the configuration file and the database:
74
+
75
+
-**TOML Precedence**: If a field is explicitly defined in your `config.toml`, it takes absolute precedence. The server will use the value from the file, and that setting will be **read-only** in the Web UI (marked as "Fixed in config file").
76
+
-**Database Fallback**: If a field is **missing** or commented out in the `config.toml`, the server will look for it in the database. These can be managed and edited via the **Security & CORS** modal in the Settings page.
77
+
-**Initial Setup**: On the first start, a default `config.toml` is created with all settings commented out, allowing the Web UI to take control of the configuration by default while providing a template for manual overrides.
78
+
65
79
#### Custom CORS Origins
66
80
67
81
By default, the server allows requests from:
68
82
- 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://.*`)
83
+
- The official Chrome extension (`chrome-extension://nglaklhklhcoonedhgnpgddginnjdadi`) if `cors_allow_aw_chrome_extension` is true (default).
84
+
- All Firefox extensions (`moz-extension://.*`) ONLY IF `cors_allow_all_mozilla_extension` is set to true.
71
85
72
-
To allow additional origins (e.g. a sideloaded Chrome extension), add them to your config:
86
+
To allow additional origins (e.g. a sideloaded Chrome extension), add them to your `cors` or `cors_regex`config:
0 commit comments