Skip to content
Crypto Write-up Advanced

Practically-exploitable Cryptographic Vulnerabilities in Matrix

The authors found several cryptographic flaws in Matrix's end-to-end encryption, including unauthenticated room membership messages, identifier confusion in out-of-band verification, and a protocol confusion where key material was accepted without checking it came over Olm. A malicious homeserver, sometimes with a colluding user, could join rooms, impersonate devices, or set a backup key to read message plaintext.

Martin R. Albrecht Follow

Published on nebuchadnezzar-megolm.github.io

We report several practically-exploitable cryptographic vulnerabilities in the end-to-end encryption in Matrix and describe proof-of-concept attacks exploiting these vulnerabilities. When relying on implementation specific behaviour, these attacks target the Matrix standard as implemented by the matrix-react-sdk and…

Martin Albrecht (@martinralbrecht), Sofía Celi (@claucece), Benjamin Dowling (@DowlingBJ), Daniel Jones (@djwj_), on nebuchadnezzar-megolm.github.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a mix of design gaps (unauthenticated room membership messages, no domain separation between device and key identifiers) and implementation bugs (accepting key material without checking it arrived over Olm, and verifying authentication at display time rather than decryption time).

Impact

A malicious homeserver, sometimes with a colluding user or device, could break confidentiality and authentication of encrypted messages, though some attacks were detectable via warnings and the IND-CCA issue was only theoretical.

What the attacker needed

Malicious or colluding homeserver; encrypted messaging enabled; victim uses Element or matrix-js-sdk

The fix

Several attacks were fixed by the coordinated disclosure, but the homeserver control of room membership and device lists remained unmitigated at disclosure, with a per-room setting and later fixes planned.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Matrix is a chat protocol where messages are meant to be encrypted so that even the server relaying them cannot read them. The researchers showed that a dishonest server could trick the app into accepting fake members, fake devices or fake encryption keys, so it could read messages it should not. The problems were mostly in how the protocol and the Element app checked (or failed to check) who sent what.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.