Skip to content
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

Device list tracking does not handle users who leave rooms #1640

Closed
richvdh opened this issue Mar 9, 2023 · 6 comments
Closed

Device list tracking does not handle users who leave rooms #1640

richvdh opened this issue Mar 9, 2023 · 6 comments

Comments

@richvdh
Copy link
Member

richvdh commented Mar 9, 2023

Suppose:

  • We share an encrypted room with Bob
  • Bob leaves that room
  • Bob signs in on a new device
  • Bob rejoins the room
  • We send an encrypted message

In this case, Bob's new device will see a UISI, because we will not encrypt for it.

The problem is that there is no way to mark Bob as 'untracked', so we think we have an up-to-date list of Bob's devices, where we do not.

I think this is related to #1191.

@poljar
Copy link
Contributor

poljar commented Mar 9, 2023

Interesting, I would have assumed that the server will tell us that Bob has changed at the same time we receive the m.room.member event that inserts Bob back into the room.

Why can't it do so?

@cvwright
Copy link

Isn't it also a problem that the crypto crate never learned about Bob leaving in the first place?

When somebody leaves (or is kicked/banned), don't you typically want to start a new chain of keys that the left user doesn't know?

@richvdh
Copy link
Member Author

richvdh commented Mar 10, 2023

I need to investigate this a bit more to figure out exactly what happens, but to do that first I need to fix element-hq/element-web#24795.

@richvdh
Copy link
Member Author

richvdh commented Mar 10, 2023

When somebody leaves (or is kicked/banned), don't you typically want to start a new chain of keys that the left user doesn't know?

Yes, but the decision of which users to encrypt for is left to the application (share_room_key takes a list of users), so that bit works ok.

@richvdh
Copy link
Member Author

richvdh commented Apr 12, 2023

Interesting, I would have assumed that the server will tell us that Bob has changed at the same time we receive the m.room.member event that inserts Bob back into the room.

Indeed, it turns out this is exactly what happens. As the spec says (my emphasis).

changed: List of users who have updated their device identity or cross-signing keys, or who now share an encrypted room with the client since the previous sync response.

So, this is a non-issue. Sorry for the noise!

@richvdh richvdh closed this as completed Apr 12, 2023
@richvdh
Copy link
Member Author

richvdh commented Apr 12, 2023

Related: here's where we originally fixed this for the js-sdk back in the day - by adding the user to changed: element-hq/element-web#4983

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants