Matrix is ​​an open instant messaging protocol. It is designed to allow users to communicate via online chat, voice over IP, and video chat.
Recently, the developers of the decentralized communications platform "Matrix" released a warning about several critical vulnerabilities that were detected in the matrix-js-sdk, matrix-ios-sdk, and matrix-android-sdk2 libraries that allow server administrators to impersonate other users and read end-to-end encrypted (E2EE) chat messages.
It is mentioned that to successfully complete an attack, access to a home server controlled by the attackers is required (home server: a server used to store client history and accounts). The use of end-to-end encryption on the client side prevents the server administrator from interfering with the messaging, but the identified vulnerabilities allow this protection to be bypassed.
The issues affect Element Matrix's main client (formerly Riot) for Web, desktop, iOS and Android, as well as third-party client applications such as Cinny, Beeper, SchildiChat, Circuli and Synod.im.
The vulnerabilities do not appear in the libraries matrix-rust-sdk, hydrogen-sdk, Matrix Dart SDK, mautrix-python, mautrix-go, and matrix-nio, as well as Hydrogen, ElementX, Nheko, FluffyChat, Siphon, Timmy, Gomuks, and Pantalaimon applications.
Note that critical severity issues are implementation issues in matrix-js-sdk and derivatives, and are not protocol issues in Matrix. The latest version of the researchers' paper we've seen incorrectly portrays Element as "the benchmark Matrix client" and confuses higher severity implementation errors with lower severity protocol criticism.
There are three main attack scenarios :
- The Matrix server administrator can break emoji-based verification (SAS, Short Authentication Chains) by using cross-signatures and impersonating another user. The issue is caused by a vulnerability (CVE-2022-39250) in the matrix-js-sdk code related to the combination of device ID handling and cross-signing keys.
- An attacker who controls the server can impersonate a trusted sender and pass a fake key to intercept messages from other users. The issue is due to a vulnerability in matrix-js-sdk (CVE-2022-39251), matrix-ios-sdk (CVE-2022-39255), and matrix-android-sdk2 (CVE-2022-39248), which caused the The client incorrectly accepts messages addressed to encrypted devices using the Megolm protocol instead of Olm , attributing the messages to the Megolm sender instead of the actual sender.
- By exploiting the vulnerabilities mentioned in the previous paragraph, the server administrator can also add a dummy spare key to the user account to extract the keys used to encrypt messages.
The researchers who identified the vulnerability also demonstrated attacks that add a third-party user to a chat or connect a third-party device to the user. These attacks exploit the fact that the service messages used to add users to the chat are not linked to the chat creator's keys and can be generated by the server administrator.
The developers of the Matrix project classified these vulnerabilities as minor , since such manipulations are not specific to Matrix and only affect clients based on the protocol, but this does not mean that they will not go unnoticed: if a user is replaced, it will be shown in the chat user list, and when a device is added, a warning will be displayed and the device will be marked as unverified (in this case, immediately after adding the unauthorized device, it will begin to receive the public keys necessary to decrypt the messages).
You'll notice that matrix-rust-sdk, hydrogen-sdk, and other XNUMXnd and XNUMXrd generation SDKs were not affected by the bugs in the root cause of critical issues here. This is precisely why we've been working to replace the first-generation SDKs with a clean, carefully written implementation of Rust in the form of matrix-rust-sdk, complete with an ongoing independent public audit.
The vulnerabilities are caused by errors in individual implementations of the Matrix protocol and are not problems with the protocol itself. The project has currently released updates for the affected SDKs and some of the client applications built on them.
Finally, if you are interested in learning more about this , you can find the details at the following link.