matrix-org / matrix-org/matrix-rust-sdk
Identity reset flow leaves broken account/device if it races with a `/keys/query`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 500
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 106
Description
STR:
1. Log in
2. Click "Can't confirm?"
3. Click "Continue reset"
4. Click "Yes, reset now"
5. Log in on another device
6. Back on the first device, enter the account password
At this point, things *appear* normal (other than the suggestion that you set up recovery) but the client has thrown away the private cross-signing keys.
Now:
7. Click "Set up recovery"
8. Now on the Encryption settings menu, Click "Set up recovery" (aside: this seems a redundant step)
9. Click "Generate your recovery key"
10. Copy the recovery key
11. Click "Done"
Now, observe:


Entering the recovery key does nothing to help, as you might expect.
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
Reproduce the reset flow while another device triggers the `/keys/query` race, then trace how identity reset and cross-signing private keys are handled. Confirm the fix by verifying that the private keys are not discarded and that the generated recovery key can restore the account state.
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