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

Unable To Decrypt meta issue #245

Open
34 of 64 tasks
BillCarsonFr opened this issue Apr 28, 2022 · 37 comments
Open
34 of 64 tasks

Unable To Decrypt meta issue #245

BillCarsonFr opened this issue Apr 28, 2022 · 37 comments
Labels
A-E2EE 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 T-Defect T-Epic Issue is at Epic level Team: Crypto Z-Chronic

Comments

@BillCarsonFr
Copy link
Member

BillCarsonFr commented Apr 28, 2022

Unable to decrypt Epic Issue

Meta issue relating to all "Unable to Decrypt" problems, a.k.a "Waiting for this message, this may take a while".

Needed information to resolve a reported issue

In order to properly debug an Unable To Decrypt error, we need logs from the receiver of the message (the one seeing the issue) and those from the sender. We can't debug issues without logs from both sides.

In your bug report, please identify which event you can't read. Either include the event ID, or something like "message from Dave at 10:10".

How to send rageshake from Element Web:

  • Click on your avatar in top left part of the screen
  • Select "All Settings"
  • Select "Help & About"
  • Then click on the submit debug logs button

How to send rageshake from Element Android:

  • Tap on the top right button on the home screen
  • Select Report Bug

image

How to send rageshake from element iOS:

  • Open the top left drawer
  • Select the Feedback button at the bottom

image


Causes of Unable to Decrypt errors

🟢: We believe that this will be fixed with Element R
🕛: Affects a feature which is not yet supported in Element R

We categorize the main sources of UISI errors as follow:

Client Issues

Sender Side

Receiver Side

Server Issues

Key Backups

Protocol Issues

Missing features

UX

Expected UTD

  • Some room history (pre-invite for example), should never be decryptable by you. This kind of history should probably be hidden or displayed differently.
  • Expected UTDs: Hide device-relative historical UTDs #2313: New devices cannot decrypt existing history until they have access to key backup

User Config

@BillCarsonFr
Copy link
Member Author

Interesting related blog post https://blog.neko.dev/posts/unable-to-decrypt-matrix.html

@jittygitty
Copy link

@BillCarsonFr Wow what a great write-up you found at https://blog.neko.dev/posts/unable-to-decrypt-matrix.html

Please correct me if I'm wrong, but having looked at that, it seems that just about all of those errors could be resolved via wizard/options provided to the user by the client which could try to resend encryption key with help of server or to even create a new one for the channel/room. I don't see any 'technical' issue/blocker other than currently missing functionality client-side to prompt user for permission to, with the help of in-between server, do what's necessary to fix room encryption/decryption.

If there's a 'security' issue with properly re-identifying the correct user, for example to re-provide keys to the other user while they've gone offline so they can pick them up from server when they are online again, can't we have a simple "challenge/response" ie question/answer to "pick-up" the keys? (I'm trying to avoid creation of a "new" room/channel and instead fix one already created but giving errors of unable to decrypt. The sender's device has not sent us the keys for this message.)

It seems the reason certain steps aren't by default taken to automatically fix such issues, is that it could be a security risk in certain situations. But if the "creator" of a room gives needed permission, it seems in a sense trivial to resolve such decryption/key errors etc. Or am I wrong and missed something?

And to the author of:
https://blog.neko.dev/posts/unable-to-decrypt-matrix.html
Many thanks!

@BillCarsonFr
Copy link
Member Author

Please correct me if I'm wrong, but having looked at that, it seems that just about all of those errors could be resolved via wizard/options provided to the user by the client which could try to resend encryption key

FTR, there used to be such UI, but it was prone to social attack and annoying in the UI.
It's something explored, but it's a bit hard to have a fix all encryption problems button. We are trying to go to the bottom of the root cause for distribution failure by moving to the rust sdk

@jittygitty
Copy link

@BillCarsonFr Ah ok guess I'm relatively new so didn't know of the older UI. Personally, I'd be ok with the "social attack" risks and UI annoyance versus the embarrassment of inviting users to my new chat and getting decryption errors.

My concern was that it may be impossible to fix the root for all cases of decryption issues, especially if some are due to security measures which may need to be over-ridden by user consent in order to fix, which brings us back to that UI annoyance.

But regardless, it's great to hear the underlying sdk is being improved to hopefully eliminate or greatly reduce these issues. I had heard of rust in conduit (I run go-dendrite) but didn't know Kotlin SDK is being all redone in rust, is that right?

Anyway, thanks again to everyone working on this! (I look forward to some beta-testing with the new sdk when its ready for that.)

@anon8675309
Copy link

The link to send debug logs does not appear on Element Web on my server. Did this UI change, or is there some option that an admin needs to enable to get that to show up?

@t3chguy
Copy link
Member

t3chguy commented Mar 17, 2023

@anon8675309 your config.json must have the URL to send debug logs to, like the example https://github.com/vector-im/element-web/blob/develop/config.sample.json#L25

@anon8675309
Copy link

Can you confirm that this is still the case? I have the bug_report_endpoint_url entry from the sample and the link to send debug logs does not appear. If it's working as expected for you, I'll set up a new server and open a new ticket with the minimal steps to reproduce. (I searched for a report of this issue and didn't find anything, but I'll do so again before opening a new issue).

@hieronymousch
Copy link

Was able to send feedback from Element desktop... and have this issue with one single user on my home server, both users on the same server. Upgraded the room to version 10 and got the error again after not even 10 messages

@Ezwen
Copy link

Ezwen commented Jun 1, 2023

Hi there, I have been encountering this problem a lot recently. I've already sent logs from element-web and element-android as the person who received encrypted messages that cannot be decrypted, but I could not yet send logs as somehow sending such problematic messages.

Question: when this situation happens in a matrix room, where a given user ends up only sending messages that cannot be decrypted by other room members, is there any (even intricate) known workaround? The only "workaround" I used so far was to upgrade the room to a newer room version, which solves the issue by creating a new room, but I can't really call this a proper solution… and right now I have this problem on a room that is already using version 10…

@lousando
Copy link

lousando commented Jun 2, 2023

@Ezwen I've found that asking sender of messages to run /discardsession usually fixes any messages moving forward. Though it does not solve the messages with the encryption issue.

@BillCarsonFr
Copy link
Member Author

Created a new issue that could cause UTDs #2374

@richvdh
Copy link
Member

richvdh commented Apr 26, 2024

2024-03-18: Element Desktop still doesn't have rust crypto enabled by default yet, but I will update this issue when it is.
2024-04-11: We are beginning to roll out to Element Desktop incrementally.

Element Desktop received Rust crypto for new sessions back in February, for what it's worth. Rollout of migration for existing sessions is tracked at element-hq/element-web#27001.

@richvdh
Copy link
Member

richvdh commented May 31, 2024

Updates on recent progress here:

  • We found and fixed a cause of broken Olm sessions on Element X iOS. You don't have to be using Element X iOS yourself to notice UTDs in this scenario: it causes problems on the sender and recipient side alike.
  • We found and fixed a bug which caused Element X to upload broken key backups.
  • We also found a bug in the Dart SDK which caused clients based on that SDK to upload broken key backups. Thanks to @krille-chan and team for fixing it.
  • We rolled out an update to Element X and Element Web R which identifies events that were sent before you logged in, and shows the resultant UTD with a clearer error message.
  • We found and fixed a bug which could cause Synapse to drop to-device messages (potentially containing message keys) during periods of high load.
  • We found and fixed a bug in the Rust matrix-sdk-crypto (so affecting Element Web R and all mobile Element clients) which could cause it to fail to download key backups (thus preventing access to messages sent before you logged in).
  • We found and fixed a bug in Synapse which could cause it to give incorrect membership state to clients, which would mean senders not sharing keys with all members of the room. (It is known, however, that there are more bugs in this area).

@penyuan
Copy link

penyuan commented Jun 1, 2024

Updates on recent progress here:

...

Just want to say a bit thank you to @richvdh for this progress update. ❤️ There is still MUCH that needs to be fixed in terms of bugs and UI/UX when it comes to encryption/decryption weirdness, and so many people I introduce to Element still get bounced off because of these problems. But at least getting these progress updates is helpful!

@kegsay
Copy link

kegsay commented Jun 20, 2024

Recently I've been giving updates for this on This Week in Matrix. If you fail to decrypt a message please:

  • send a bug report to us and mention:
    • the event ID which failed to decrypt,
    • whether it was 1 or many events which failed to decrypt,
    • if many events, are they all from different people?
  • ask the sender to also send a bug report mentioning the event ID

We often need both sides of the conversation to fix the issue.

It would also be helpful for us if you can opt-in to analytics, as that feeds into our graphs which plot UTDs in aggregate. The general trend of the past few months has thankfully been fewer UTDs across clients that opt-in, but there is more work to be done here.

@yennor
Copy link

yennor commented Jun 20, 2024

I usually got that kind of problem when me or the peer beeing in an area with bad mobile phone connection. With bad I mean really bad. You can get disconnected from the network for several minutes all the time, randomly get connected again for a few seconds, or beeing connected, but almost no data gets through.
I haven't been there (rural area of Colombia) since last year and won't for a few months. So So I can't tell if the situation improved with the new clients.
But maybe for your test-suite, simulate random tcp package drops (very high percentage) with high RTT (Several seconds, sometimes I measured up to 20 seconds. around 5-8 seconds is normal). And sent a few thousand messages there and back.

@jittygitty
Copy link

Does matrix-org/matrix-js-sdk#454 already "implement" solution for: #647 ?
And if so how would my friend request keys from me (on Desktop Element) on a new fresh install of his?

Are we able now to send decryption keys to whomever we wish?

@t3chguy
Copy link
Member

t3chguy commented Jul 1, 2024

@jittygitty yes but Rust Crypto does not support that and that is what Element uses, so the js-sdk PR is unrelated

@jittygitty
Copy link

@t3chguy That's good news, so I guess if I wanted to make use of this feature, I would have to install the "Web" version client of element chat on my webserver? (I currently run Dendrite already, but with mobile and Desktop clients only.)

Or is there another client app that uses js-sdk? (Element Desktop does not use it?) Or will rust crypto gain it soon?

I use another account on 'matrix.org' using desktop+mobile, for that acct. we can simply login at chat.element.io and if I'm logged in via my other devices, I can send keys to my web chat.element.io and resend to friend who lost his? thx

@t3chguy
Copy link
Member

t3chguy commented Jul 1, 2024

Element Desktop = Element Web + Electron. Element Web only supports Rust Crypto at this time. As for other matrix-js-sdk consumers I suggest finding a place discussing Matrix rather than Element specifically.

@jittygitty
Copy link

Apologies, indeed, seems I'm confused as to what matrix SDK is used by what "client", and I had not noticed the matrix-org/matrix-js-sdk#454 was outside of element-hq repositories. So, I guess you are saying that likely none of the clients under https://github.com/element-hq are able to leverage that matrix-js-sdk pull 454?

Is there a place I can find all such pertinent information on the various clients available? If anyone can point me in the right direction with a link would be appreciated. Otherwise, I'll try some search engine lookups to dig for such info. thx

@mpeter50
Copy link

mpeter50 commented Jul 1, 2024

It seems Cinny uses the matrix-js-sdk, and maybe there are more, but I havent found another client that does.
Then, its an other question if Cinny makes use of this feature of the SDK. You could ask about that in Cinny's support room.

@richvdh
Copy link
Member

richvdh commented Jul 4, 2024

Another round-up of recent updates. (Most of these have already been reported in TWIM, but I think it's handy to have a record here too.)

  • We found and fixed a cause of broken Olm sessions on Element iOS. As with the previous fix to EX iOS: you don't have to be using Element iOS yourself to notice UTDs in this scenario: it causes problems on the sender and recipient side alike.
  • We also have more fixes to both Element X iOS (#2944) and Element X Android (#3050) which could cause broken Olm Sessions.
  • We found and fixed a bug in matrix-rust-sdk affecting Element X.
  • We added a workaround to the sliding-sync proxy which would guard against messages being lost after the database was dropped, potentially causing UTDs for Element X clients.
  • We rolled out a change to Synapse and all Element clients, which will identify messages sent before you joined a room, and let you know you shouldn't expect to decrypt them.

A reminder that we're still at war with this issue, and it's incredibly helpful for people to send debug logs when they come across UTD errors.

That said, our analytics show that we are starting to make progress here:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-E2EE 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 T-Defect T-Epic Issue is at Epic level Team: Crypto Z-Chronic
Projects
None yet
Development

No branches or pull requests