matrix-org / matrix-org/matrix-rust-sdk
Messages sent from insecure devices can sometimes be decrypted when `Exclude Insecure Device` is on
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
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
- "key upgrades" https://github.com/matrix-org/matrix-rust-sdk/issues/4698
- Lack of authenticated backup
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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