-
Notifications
You must be signed in to change notification settings - Fork 412
MSC4153: Exclude non-cross-signed devices #4153
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
Changes from 3 commits
a9071b1
33cb6a5
f02666f
b2c9541
5e01739
010b294
ea450d2
31748ab
6084c6e
aeceee3
1ef347d
5d4bd81
99d440a
2019c4c
48cb558
6dadee8
772f556
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
richvdh marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
# MSC4153: Exclude non-cross-signed devices | ||
|
||
End-to-end encryption was first introduced to Matrix in 2016. Over the years, | ||
uhoreg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
more encryption-related features have been added, such as key verification, | ||
cross-signing, key backup, and secure storage/sharing. | ||
|
||
The current spec allows clients freedom to choose what features to implement. | ||
And while clients should be able to make decisions based on their threat model, | ||
there are behaviours that the spec can recommend that will improve the user | ||
experience and security of encrypted conversations. | ||
|
||
In general, this MSC proposes to standardize on using cross-signing as a basis | ||
for trusting devices. While a user may be unable to verify every other user | ||
that they communicate with, or may be unaware of the need to verify other | ||
users, cross-signing gives some measure of protection and so should be used | ||
where possible. One of the goals of this MSC is to reduce the number of | ||
warnings that users will encounter by taking advantage of cross-signing. | ||
|
||
## Proposal | ||
|
||
The changes below only apply to clients that support encryption. | ||
|
||
### Users should have cross-signing keys | ||
|
||
Clients should create new cross-signing keys for users who do not yet have | ||
cross-signing keys. | ||
|
||
### Users should have Secret Storage | ||
|
||
Secret Storage allows users to keep secrets on the server so that they are | ||
accessible when the user logs in to a new device. | ||
|
||
The spec currently does not give recommendations for what information is stored | ||
in Secret Storage, or even whether Secret Storage is available to users. A | ||
user’s Secret Storage should contain the user’s cross-signing secret keys and | ||
the key backup decryption key (if the user is using key backup). This ensures | ||
that users use cross-signing and key backup on new devices. | ||
|
||
Users should have Secret Storage with a default key (a key referred to by | ||
`m.secret_storage.default_key`) that encrypts the private cross-signing keys | ||
and key backup key (if available). | ||
|
||
### Verifying individual devices of other users is deprecated | ||
|
||
When one user verifies a different user, the verification should verify the | ||
users’ cross-signing keys. Any flow that verifies only the device keys of | ||
different users is deprecated. Verifying a user’s own device keys is still | ||
supported. | ||
|
||
### Devices should be cross-signed | ||
|
||
Clients should encourage users to cross-sign their devices. This includes both | ||
when logging in a new device, and for existing devices. Clients may even go so | ||
far as to require cross-signing of devices by preventing the user from using | ||
the client until the device is cross-signed. If the user cannot cross-sign | ||
their device (for example, if they have forgotten their Secret Storage key), | ||
the client can allow users to reset their Secret Storage, cross-signing, and | ||
key backup. | ||
uhoreg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
### Clients should flag when cross-signing keys change | ||
|
||
If Alice’s cross-signing keys change, Alice’s own devices must alert her to | ||
this fact, and prompt her to re-cross-sign those devices. If Bob is in an | ||
encrypted room with Alice, Bob’s devices should inform him of Alice’s key | ||
change and should prevent him from sending an encrypted message to Alice | ||
without acknowledging the change. | ||
|
||
Bob’s clients may behave differently depending on whether Bob had previously | ||
verified Alice or not. For example, if Bob had previously verified Alice, and | ||
Alice’s keys change, Bob’s client may require Bob to re-verify, or may display | ||
a more aggressive warning. | ||
|
||
Note that this MSC does not propose a mechanism for remembering previous | ||
cross-signing keys between devices. In other words if Alice changes her | ||
cross-signing keys and then Bob logs in a new device, Bob’s new device will not | ||
know that Alice’s cross-signing keys had changed, even if Bob has other devices | ||
that were previously logged in. Such a mechanism could be proposed by another | ||
MSC. | ||
|
||
### Room keys and secrets should by default not be sent to non-cross-signed devices | ||
uhoreg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
uhoreg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
uhoreg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Since non-cross-signed devices don’t provide any assurance that the device | ||
belongs to the user, and server admins can trivially create new devices for | ||
users, clients should not send room keys to non-cross-signed devices by | ||
default. Clients may provide users the ability to encrypt to specific | ||
non-cross-signed devices, for example, for development or testing purposes. | ||
|
||
In addition, users should not send secrets (via Secret Sharing) to their own | ||
devices that are not cross-signed. | ||
|
||
### Messages from non-cross-signed devices should be ignored by default | ||
uhoreg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Similarly, clients have no assurance that encrypted messages sent from | ||
non-cross-signed devices were sent by the user, rather than an | ||
impersonator. Therefore messages sent from non-cross-signed devices cannot be | ||
trusted and should not be displayed differently to the user. Again, clients | ||
may be allow the user to override this behaviour for specific devices for | ||
uhoreg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
development or testing purposes. | ||
|
||
uhoreg marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Proposed addition: Updates to documentationIf MSC4161 is merged before
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (As per #4161 (comment) I think it makes sense to leave this material out of MSC4161 and add it when this MSC is merged.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think anything needs to be done here, since it looks like this MSC will be accepted before 4161, but leaving this open for documentation purposes. |
||
## Potential Issues | ||
|
||
### Client support | ||
|
||
If a user has devices that are not cross-signed, they will not be able to | ||
communicate with other users whose clients implement this proposal completely, | ||
due to the last two points. Thus we encourage clients to implement | ||
uhoreg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
cross-signing as soon as possible, and to encourage users to cross-sign their | ||
devices, and clients should delay the implementation of the last two points (or | ||
make it optional) until most clients have implemented cross-signing. | ||
richvdh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
TODO: status of cross-signing in clients | ||
|
||
### Bots and application services | ||
|
||
This is a special case to the issue above, but seems to be a large enough class | ||
that it deserves its own mention: support for cross-signing in bots and | ||
application services may be less common than in interactive clients. When a | ||
client fully implements this proposal, users will be unable to interact with | ||
bots and application services in encrypted rooms if they do not support | ||
cross-signing. | ||
Comment on lines
+213
to
+218
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there some timeline specifying some duration for application services/bot authors to implement support for this? It seems that, if this is implemented and enabled by default too soon, this would prevent use of popular e2be bridges like I see the note that support is planned for application services in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to worry about mautrix-go, but it is a valid concern for less actively developed libraries. It'd probably be appropriate to define a recommended minimum time before this MSC is enabled by default, with the expectation that at least Element would follow that timeline, then be noisy about it in TWIM and other channels to make bot/library developers aware. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Element is planning on making an announcement soon about enabling this MSC, but it will probably be a bit before it's enabled by default. The timing for enabling it by default will depend on somewhat on how well it's supported by other clients, bots, and bridges, and I'd expect that there will be noise made about it before it's enabled by default. I don't want to specify a timeline, as various factors will affect it, but I would guess that it would be on the order of months. |
||
|
||
TODO: status of cross-signing in bots/application services | ||
uhoreg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
## Alternatives | ||
|
||
## Security considerations | ||
uhoreg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Unstable prefix | ||
|
||
No new names are introduced, so no unstable prefix is needed. | ||
|
||
## Dependencies | ||
|
||
Though not strictly dependencies, other MSCs improve the behaviour of this MSC: | ||
- [Authenticated backups | ||
(MSC4048)](https://github.com/matrix-org/matrix-spec-proposals/pull/4048) | ||
will improve the user experience by ensuring that trust information is | ||
preserved when loading room keys from backup. TODO: I think we also need to | ||
add information to the backup about the cross-signing status of the device | ||
- [Including device keys with Olm-encrypted events | ||
(MSC4147)](https://github.com/matrix-org/matrix-spec-proposals/pull/4147) | ||
allows recipients to check the cross-signing status of devices that have been | ||
deleted |
Uh oh!
There was an error while loading. Please reload this page.
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:
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.
I believe that EW and EX both implement this, via their respective labs flags.
EW's setting looks like this: