question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`m.room.encryption` state event missing

See original GitHub issue

Steps to reproduce

This only happened to me with one room, so I don’t know how to reproduce.

  1. encrypted 1-on-1 chat created with element-desktop works as usual
  2. sending message into that room from element-android
  3. element-desktop warns that the message is Unencrypted

I’ve sent messages to that room using element-android on 2021-01-05 (probably with the latest version from f-droid at that time) without experiencing this problem.

Outcome

What did you expect?

Element-Android should recognize that the room has encryption enabled and send encrypted messages.

What happened instead?

Element-Android does not recognize the room as encrypted. The settings screen of the room tells me “Messages here are not end-to-end encrypted”.

Checking in the dev tools, there is no m.room.encryption in the “State Events” view. Checking with Element-Desktop, the state event is shown.

Your phone model

Fairphone 3

Operating system version

Android 10

Application version and app store

1.3.15 from f-droid

Homeserver

Synapse 1.47.1

Will you send logs?

No

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
hex-mcommented, Feb 7, 2022

I confirm that the issue is gone after the update. Thanks for the clear communication and for the fast fix! ❤️

1reaction
BillCarsonFrcommented, Feb 3, 2022

This bug just resulted in me sending out unencrypted messages in a chat I thought was encrypted. Those messages were harmless, but I believe that some kind of safeguard needs to be added to ensure a bug like this causes no messages to be sent, not unencrypted ones.

Edit: I have just received word from @t3chguy that the Desktop and Web clients already have such a safeguard. That the Android client does degrades the security of the entire app ecosystem. Are all the clients not held to equal security standards?

Thx for the report, Android has a similar safeguard, but implemented differently and in this case it didn’t resist to the issue (a local wipe ou of states). The root issue is found and new release is cooking.

But yes currently the 3 platforms are using 3 different SDKs, that are all a bit different and evolve at different pace. That’s why we are moving towards having a single SDK cross platform (rust sdk).

Additional safeguard and defensive coding are beeing added meanwhile and will come in next releases

Read more comments on GitHub >

github_iconTop Results From Across the Web

End-to-End Encryption implementation guide - Matrix.org
To enable encryption in a room, a client should send a state event of type m.room.encryption , and content { "algorithm": "m.megolm.v1.aes-sha2" }...
Read more >
Source code for nio.events.room_events - Read the Docs
Encrypted events may have different fields depending on the algorithm that was used to encrypt them. This function checks the algorithm of the...
Read more >
matrix_sdk::encryption - Rust
The m.room.encryption state event of the room decides how long a room key should be used. By default this is for 100 messages...
Read more >
draft-ralston-mimi-matrix-transport-00 - IETF Datatracker
Events, identified as $base64HashOfItself, have a type (m.room.message or ... State Events are versioned key/value data which are pinned in the room, ...
Read more >
FAQs | Help and customer support - Element
Are all of my messages encrypted? No, messages are only encrypted in rooms with encryption enabled. You can enable encryption by going to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found