-
Notifications
You must be signed in to change notification settings - Fork 418
MSC4385: Pushing secrets to other devices #4385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
uhoreg
wants to merge
3
commits into
matrix-org:main
Choose a base branch
from
uhoreg:secret_send_without_requestid
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+78
−0
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # MSC4385: Pushing secrets to other devices | ||
|
|
||
| [MSC1946](https://github.com/matrix-org/matrix-spec-proposals/pull/1946) | ||
| introduced the `m.secret.request` and `m.secret.send` events, which allow a | ||
| device to request a secret from another device, and for the other device to send | ||
| the secret to the first device. In that MSC, an `m.secret.send` must only be | ||
| sent as a response to `m.secret.request`; a device has no way of sharing a | ||
| secret without it being requested. | ||
|
|
||
| However, there are situations in which a device may want to send a secret to | ||
| other devices, without the secret being requested. For example, if a device | ||
| changes the private key for key backup, it can share the key with other devices | ||
| so that they can access the key backup. | ||
|
|
||
| ## Proposal | ||
|
|
||
| We introduce a new event type, `m.secret.push`, which is used to sharing a | ||
| secret with other devices without waiting for a request. It MUST always be sent | ||
| encrypted. It contains the properties: | ||
|
|
||
| - `secret` (required): the contents of the secret (this is the same as the | ||
| `secret` property of the [`m.secret.send` | ||
| event](https://spec.matrix.org/v1.16/client-server-api/#msecretsend) event) | ||
| - `name` (required): the name of the secret (this is the same as the name | ||
| property of the | ||
| [`m.secret.request`](https://spec.matrix.org/v1.16/client-server-api/#msecretrequest) | ||
| event). | ||
|
|
||
| `m.secret.push` events MUST only be accepted from cross-signed devices belonging | ||
| to the same user. In addition, the client MAY prompt the user before accepting | ||
| the `m.secret.push` event. The client MAY also only accept certain secrets. | ||
| For example, the client could accept the key backup secret, but could require | ||
| re-verification rather than accepting the cross-signing secrets. | ||
|
|
||
| ## Potential issues | ||
|
|
||
| Clients that do not implement this proposal will not accept `m.secret.push`, and | ||
| so the event will have been sent needlessly. However, clients that do not | ||
| implement this proposal should ignore such events, so they will not cause any | ||
| problems for these clients. | ||
|
|
||
| If a client is offline while a secret is changed multiple times, it will receive | ||
| multiple `m.secret.push` events, and will have to determine which one is the | ||
| current one. For the existing secrets, there are easy ways of determining which | ||
| secret "works". | ||
|
|
||
| ## Alternatives | ||
|
|
||
| Rather than pushing out a secret when it is changed, the user's other clients | ||
| could try to notice when a secret is changed, and then broadcast an | ||
| `m.secret.request` to all the user's other devices. However, this could result | ||
| in delays in obtaining the secret if the device that changed the secret is not | ||
| online when the request is sent out. As well, it could result in many extra | ||
| events being sent, since the requesting device does not know which device it | ||
| needs to request from, and so must broadcast `m.secret.request` events to all | ||
| the user's other devices. | ||
|
|
||
| ## Security considerations | ||
|
|
||
| An attacker who takes control of a device could send out a secret that is | ||
| controlled by the attacker. For example, the attacker could create a new key | ||
| backup and send out the private key so that other clients will use the new | ||
| backup, allowing the attacker to read new keys uploaded to the key backup. | ||
| However, if the attacker has taken control of a device, it is likely that they | ||
| would have access to the existing secret, and so would not gain anything by | ||
| sending out a new secret. For this reason, `m.secret.push` events MUST only be | ||
| accepted from cross-signed devices, so that the attacker cannot just create a | ||
| new device and push out secrets. Clients can also apply other mitigations such | ||
| as prompting the user when a new secret is received. | ||
|
|
||
| ## Unstable prefix | ||
|
|
||
| Until this proposal is accepted, the name `io.element.msc4385.secret.push` | ||
| should be used rather than `m.secret.push` for the event name. | ||
|
|
||
| ## Dependencies | ||
|
|
||
| None. |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation requirements: