Skip to content

Commit e462950

Browse files
authoredFeb 17, 2025··
Document consequences of replacing secrets (#18138)
Document consequences of replacing secrets. The covered config options are `registration_shared_secret`, `macaroon_secret_key`, `form_secret` and `worker_replication_secret`. Even though I looked at the source code to check the added documentation is right, I would appreciate additional verification of the statements made. In an hand-wavy attempt at classifying how bad the consequences of secret replacement are, I added some explanations as warnings and others as regular paragraphs. Closes #17971 ### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [x] Pull request is based on the develop branch * [x] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [x] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
1 parent 3e34f5c commit e462950

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
 

‎changelog.d/18138.doc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Document consequences of replacing secrets.

‎docs/usage/configuration/config_documentation.md

+19
Original file line numberDiff line numberDiff line change
@@ -2592,6 +2592,14 @@ This is primarily intended for use with the `register_new_matrix_user` script
25922592
(see [Registering a user](../../setup/installation.md#registering-a-user));
25932593
however, the interface is [documented](../../admin_api/register_api.html).
25942594

2595+
Replacing an existing `registration_shared_secret` with a new one requires users
2596+
of the [Shared-Secret Registration API](../../admin_api/register_api.html) to
2597+
start using the new secret for requesting any further one-time nonces.
2598+
2599+
> ⚠️ **Warning** – The additional consequences of replacing
2600+
> [`macaroon_secret_key`](#macaroon_secret_key) will apply in case it delegates
2601+
> to `registration_shared_secret`.
2602+
25952603
See also [`registration_shared_secret_path`](#registration_shared_secret_path).
25962604

25972605
Example configuration:
@@ -3168,6 +3176,11 @@ A secret which is used to sign
31683176
If none is specified, the `registration_shared_secret` is used, if one is given;
31693177
otherwise, a secret key is derived from the signing key.
31703178

3179+
> ⚠️ **Warning** – Replacing an existing `macaroon_secret_key` with a new one
3180+
> will lead to invalidation of access tokens for all guest users. It will also
3181+
> break unsubscribe links in emails sent before the change. An unlucky user
3182+
> might encounter a broken SSO login flow and would have to start again.
3183+
31713184
Example configuration:
31723185
```yaml
31733186
macaroon_secret_key: <PRIVATE STRING>
@@ -3195,6 +3208,9 @@ A secret which is used to calculate HMACs for form values, to stop
31953208
falsification of values. Must be specified for the User Consent
31963209
forms to work.
31973210

3211+
Replacing an existing `form_secret` with a new one might break the user consent
3212+
page for an unlucky user and require them to reopen the page from a new link.
3213+
31983214
Example configuration:
31993215
```yaml
32003216
form_secret: <PRIVATE STRING>
@@ -4443,6 +4459,9 @@ HTTP requests from workers.
44434459
The default, this value is omitted (equivalently `null`), which means that
44444460
traffic between the workers and the main process is not authenticated.
44454461

4462+
Replacing an existing `worker_replication_secret` with a new one will break
4463+
communication with all workers that have not yet updated their secret.
4464+
44464465
Example configuration:
44474466
```yaml
44484467
worker_replication_secret: "secret_secret"

0 commit comments

Comments
 (0)
Please sign in to comment.