matrix-org / matrix-org/matrix-rust-sdk

Messages sent from insecure devices can sometimes be decrypted when `Exclude Insecure Device` is on

Open
#5,117 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.3k
Forks
500
Avg merge
1d 16h
Merged PRs (30d)
106

Description

I have enabled the option to Exclude insecure devices, and then some insecure messages suddenly appeared in the room.
Notice that the message has the correct warning, but it should have fail to decrypt

Image

Here is the rageshake:
https://github.com/element-hq/element-x-ios-rageshakes/issues/3881

This appear to be a case of backup vs late key race. The key is first received from (unauthenticated) backup, so the message is decrypted as a legacy message (gray shield).
Then the late key is received, and then the proper "safety" of the key is determined. The verification state is updated but decryption is not reverted.

It is related to

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the backup-versus-late-key flow described in the issue, using the linked rageshake and the related key-upgrades issue as context. Check where the verification state changes after backup decryption; done means a message received from an insecure device remains undecryptable when Exclude Insecure Device is enabled, even after the late key arrives.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.