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

After reloading, my own failed-to-send message is UTD #27334

Open
Tracked by #245
andybalaam opened this issue Apr 15, 2024 · 1 comment
Open
Tracked by #245

After reloading, my own failed-to-send message is UTD #27334

andybalaam opened this issue Apr 15, 2024 · 1 comment
Labels
A-E2EE A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround Z-UISI Unable to decrypt errors

Comments

@andybalaam
Copy link
Member

andybalaam commented Apr 15, 2024

See rageshake https://github.com/matrix-org/element-web-rageshakes/issues/25454 (cc @bnjbvr )

It is possible to get a UTD (Unable To Decrypt) for your own message by following these steps.

  • Send an encrypted message that fails to send
  • Refresh Element Web
  • Observe that the message in your timeline is UTD, even if it then successfully sends

Here is what we think is happening:

  • JS wants to send an event
  • JS asks Rust to encrypt the event, which works and the megolm session is saved by Rust
  • JS tries to PUT the event to the homeserver but fails
  • User refreshes
  • JS has the event pending to send but with no ID because it hasn't sent. It uses a "fake" ID based on the transaction ID it chose for the PUT request
  • JS asks Rust to decrypt the event so it can display it
  • Rust refuses because the event ID is incorrect.

The Rust returns an error like:

DecryptionError[msg: leading sigil is incorrect or missing at line 1 column 63

Because the JS is providing event JSON containing an event ID that does not begin with $.

Possible fixes:

  1. Change the "fake"/temporary ID the JS uses for events that failed to send. We don't know whether this will have impact on other code - maybe some code somewhere uses the lack of a $ to infer that this event failed to send? Or
  2. Check the event ID just before we send the event JSON to rust and add some fixed prefix e.g. $TRANS- to make the ID acceptable to the Rust code.
  3. Change the Rust to accept non-$-prefixed IDs, but this doesn't seem a good idea, since it is correct to expect event IDs to start with $.
@andybalaam andybalaam added the Z-UISI Unable to decrypt errors label Apr 15, 2024
@dbkr dbkr added S-Major Severely degrades major functionality or product features, with no satisfactory workaround A-E2EE O-Occasional Affects or can be seen by some users regularly or most users rarely labels Apr 16, 2024
@richvdh richvdh added the A-Element-R Issues affecting the port of Element's crypto layer to Rust label May 1, 2024
@NetSysFire
Copy link

Could reproduce just that yesterday with 1.11.86.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-E2EE A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround Z-UISI Unable to decrypt errors
Projects
None yet
Development

No branches or pull requests

4 participants