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

ElementR: Reset everything if forgot passphrase does not reset the backup #26717

Closed
BillCarsonFr opened this issue Dec 8, 2023 · 2 comments · Fixed by matrix-org/matrix-js-sdk#3976
Assignees
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround Z-Labs

Comments

@BillCarsonFr
Copy link
Member

Step to reproduce

  1. Create an account and setup recovery

  2. Logout

  3. Login again with this account

  4. When asked to verify select "verify with passphrase"

  5. Click on forgot passphrase and reset everything

  6. Complete the flow (use a passphrase, re-auth)

Acutal

The old backup is still the current one, and you don't have the key
=> Creates a desynced 4S situation

image

Connect this session will fail as it will try to get the backup decryption key from 4S and it's not there.
ALso there is that in logs

rageshake.ts:77 TypeError: Reflect.get called on non-object
    at Reflect.get (<anonymous>)
    at matrix_sdk_crypto_wasm.js:8274:1
    at handleError (matrix_sdk_crypto_wasm.js:330:1)
    at module.exports.__wbg_get_97b561fb56f034b5 (matrix_sdk_crypto_wasm.js:8273:58)
    at js_sys::Reflect::get::h49482ab833783b5d (01551216:0x32dfd6)
    at js_sys::try_iter::h60031c3cef7d60b3 (01551216:0x23b0ca)
    at vodozemac::types::curve25519::_::<impl serde::de::Deserialize for vodozemac::types::curve25519::Curve25519PublicKey>::deserialize::he56edfd0b83c9705 (01551216:0x2ba683)
    at olmmachine_importBackedUpRoomKeys (01551216:0xa2224)
    at OlmMachine.importBackedUpRoomKeys (matrix_sdk_crypto_wasm.js:4145:1)
    at RustBackupManager.importBackedUpRoomKeys (backup.ts:209:31)

Expected

Should have reset backup also

@BillCarsonFr BillCarsonFr added the A-Element-R Issues affecting the port of Element's crypto layer to Rust label Dec 8, 2023
@github-actions github-actions bot added the Z-Labs label Dec 8, 2023
@MidhunSureshR MidhunSureshR added S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience labels Dec 18, 2023
@uhoreg uhoreg self-assigned this Dec 21, 2023
@uhoreg
Copy link
Member

uhoreg commented Dec 21, 2023

Tracing through the code, it looks like this is because the reset code only calls bootstrapCrossSigning and not bootstrapSecretStorage (why do we have two functions?). Which means that this looks like it's an issue with current Element Web too. But looking through the react-sdk, it looks like there are a few places where it calls bootstrapCrossSigning and not bootstrapSecretStorage, so I'll go through those and check which places should be calling both.

Never mind, I missed a function call. It actually is calling bootstrapSecretStorage somewhere.

@uhoreg
Copy link
Member

uhoreg commented Dec 29, 2023

Fixed by matrix-org/matrix-js-sdk#3976

@uhoreg uhoreg closed this as completed Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround Z-Labs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants