-
Notifications
You must be signed in to change notification settings - Fork 415
MSC3673: Encrypted ephemeral data units #3673
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # MSC3673 - Encrypting ephemeral data units | ||
|
|
||
| ## Problem | ||
|
|
||
| With the introduction of [MSC2476](https://github.com/ananace/matrix-doc/blob/user-defined-edus/proposals/2477-user-defined-ephemeral-events.md) | ||
| we now have the ability to send and receive custom, user-defined ephemeral data | ||
| units. This is a great mechanism for transferring short-lived data, applicable in | ||
| a variety of situations where persistence is not desired. | ||
|
|
||
| Unfortunately E2E encryption for EDUs isn't currently defined and some | ||
| situations, like live user location sharing, come with privacy concerns, moment | ||
| in which that becomes a problem. | ||
|
|
||
| ## Proposal | ||
|
|
||
| This MSC proposes a generic mechanism for end to end encrypted ephemeral data | ||
| units, building on top of [MSC2476](https://github.com/ananace/matrix-doc/blob/user-defined-edus/proposals/2477-user-defined-ephemeral-events.md) | ||
|
|
||
| We would like to wrap them inside the standard encryption envelope: | ||
|
|
||
| ```json5 | ||
| { | ||
| "algorithm": "m.megolm.v1.aes-sha2", | ||
| "sender_key": "<sender_curve25519_key>", | ||
| "device_id": "<sender_device_id>", | ||
| "session_id": "<outbound_group_session_id>", | ||
| "ciphertext": "<encrypted_payload_base_64>" | ||
| } | ||
| ``` | ||
|
|
||
| in which the `ciphertext` will contain the custom EDUs payload and which will be | ||
| sent to `rooms/{roomId}/ephemeral/m.room.encrypted/{txnId}`, similar to | ||
| encrypted timeline events . | ||
|
|
||
| The Megolm keys required to decrypt this EDU should be shared over Olm just like | ||
| regular encrypted timeline events. | ||
|
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 think it would be worth clarifying whether you can use the same megolm session for normal room events and for ephemeral events. (FWIW, I think you should use a separate megolm session, and that it should have the 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. Unfortunately I don't know much about how that works. Would adding a new session significantly complicate things client side? Also, what are the advantages/disadvantages? 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. The advantage of using separate keys is increased confidentiality protection against malicious homeserver attacks. The HS could store encrypted EDUs indefinitely since all EDUs have to pass through it. If we used regular Megolm sessions ("room keys") for encrypting EDUs, then in the event that the server somehow managed to get a hold of the regular session, it would also have complete historical visibility of the EDUs sent during the time that this session was active. Using an unshareable separate Megolm session for this purpose alleviates this risk. The disadvantage is that it increases to-device traffic and the number of Megolm sessions and session operations, which can be slow. If it turns out to be a problem, we could allow EDU Megolm sessions to be rotated slower than normal sessions. 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. In what scenarios would you expect the homeserver to be able to get ahold of a regular session, but not of the separate session for EDUs? I would naively expect the same set of entities to have keys for both, so also any compromise to affect both or neither. 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. Not any legitimate scenarios, but there can always be implementation bugs. From my POV, this is just an extra degree of separation for some extra hardening, so that stealing one does not compromise the other.
Room keys are probably in a bit of a worse position since they get forwarded/re-shared to other devices in several situations (for instance, upon |
||
|
|
||
| Clients will receive the encrypted payloads in the `/sync`s `ephemeral` | ||
| dictionary where `type` will be equal to `m.room.encrypted` and which can be | ||
| decrypted using the pre-shared Megolm keys. | ||
|
|
||
| ## Alternatives | ||
|
|
||
| We are not aware of any other straightforward solution for sharing sensisitive | ||
| ephemeral data between users. | ||
Uh oh!
There was an error while loading. Please reload this page.