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

User verification via room might fail depending on the encryption settings #4768

Open
BillCarsonFr opened this issue Mar 6, 2025 · 5 comments

Comments

@BillCarsonFr
Copy link
Member

BillCarsonFr commented Mar 6, 2025

Step to reproduce:

  • Alice logs in on Element X
  • Alice creates a DM with Bob
  • Alice logs in on web but does not verify this new session.
  • (Notice that at this point, Alice sending a message from Element X will fail because Alice has an insecure device.)
  • On Element X, Alice goes to Bob's profile and tries to verify him

Actual:
Nothing happens

Expected:
Verification should start

The error is:

2025-03-06T18:45:00.024483Z ERROR elementx: Failed requesting verification for user @xxxx:matrix.org with error: Generic(msg: "encryption failed due to an error collecting the recipient devices: one or more verified users have unsigned devices") | SessionVerificationControllerProxy.swift:113 | spans: root

2025-03-06T18:45:00.024632Z  INFO elementx: Transitioning from `requestingVerification` to `initial` with event `didFail` | SessionVerificationScreenStateMachine.swift:128 | spans: root

As per spec:

When using in-room messages and the room has encryption enabled, clients should ensure that encryption does not hinder the verification. For example, if the verification messages are encrypted, clients must ensure that all the recipient’s unverified devices receive the keys necessary to decrypt the messages, even if they would normally not be given the keys to decrypt messages in the room. Alternatively, verification messages may be sent unencrypted, though this is not encouraged.

A similar "fix" was done on legacy sdks, to "allow" sending verification messages even to insecure devices

@BillCarsonFr BillCarsonFr changed the title Verification via room migh fail depending on the encryption settings Verification via room might fail depending on the encryption settings Mar 6, 2025
@andybalaam
Copy link
Member

We think this will be fixed by "Exclude Insecure Devices" - we should check that assumption.

@andybalaam
Copy link
Member

Andreas will check this.

@richvdh richvdh changed the title Verification via room might fail depending on the encryption settings User verification via room might fail depending on the encryption settings Mar 10, 2025
@mxandreas
Copy link

On Element X, Alice goes to Bob's profile and tries to verify him

Tested and can confirm that if before doing this Alice turns ON the feature flag to exclude insecure devices, the user verification works.

@BillCarsonFr
Copy link
Member Author

We think this will be fixed by "Exclude Insecure Devices" - we should check that assumption.

Might fix this specific case, but there are probably other cases.

For example if the other user is in verification violation, there are 2 options to restore communication:

  • re-verify
  • withdraw verification

But in that case re-verify won't work in Exclude Insecure Devices mode, because all the devices of the other users will be excluded, so verification is impossible. Unless of course you withdraw verification first, but then if the verification fails you have reverted security.

@mxandreas
Copy link

But in that case re-verify won't work in Exclude Insecure Devices mode, because all the devices of the other users will be excluded, so verification is impossible. Unless of course you withdraw verification first, but then if the verification fails you have reverted security.

That's a valid point, we do want to allow re-verify without requiring withdrawing verification. We then have to do the same fix as for the legacy apps which is to send such messages even when the device is insecure.

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