CVE-2021-40824
Logic error in Matrix SDK for Android
A logic error in the room key sharing functionality of Element Android before 1.2.2 and matrix-android-sdk2 (aka Matrix SDK for Android) before 1.2.2 allows a malicious Matrix homeserver present in an encrypted room to steal room encryption keys (via crafted Matrix protocol messages) that were originally sent by affected Matrix clients participating in that room. This allows the attacker to decrypt end-to-end encrypted messages sent by affected clients.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
NVD Score used
5.9
A logic error in the room key sharing functionality of Element Android before 1.2.2 and matrix-android-sdk2 (aka Matrix SDK for Android) before 1.2.2 allows a malicious Matrix homeserver present in an encrypted room to steal room encryption keys (via crafted Matrix protocol messages) that were originally sent by affected Matrix clients participating in that room. This allows the attacker to decrypt end-to-end encrypted messages sent by affected clients.
- Record
CVE-2021-40824- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - CVSS 2.0
- 4.3 Medium
AV:N/AC:M/Au:N/C:P/I:N/A:N - Weakness
- CWE-290
- Updated
- 2026-11-02
CVE List No score
A logic error in the room key sharing functionality of Element Android before 1.2.2 and matrix-android-sdk2 (aka Matrix SDK for Android) before 1.2.2 allows a malicious Matrix homeserver present in an encrypted room to steal room encryption keys (via crafted Matrix protocol messages) that were originally sent by affected Matrix clients participating in that room. This allows the attacker to decrypt end-to-end encrypted messages sent by affected clients.
- Record
CVE-2021-40824- Updated
- 2026-11-02
EUVDEUVD-2022-4389 No score
A logic error in the room key sharing functionality of Element Android before 1.2.2 and matrix-android-sdk2 (aka Matrix SDK for Android) before 1.2.2 allows a malicious Matrix homeserver present in an encrypted room to steal room encryption keys (via crafted Matrix protocol messages) that were originally sent by affected Matrix clients participating in that room. This allows the attacker to decrypt end-to-end encrypted messages sent by affected clients.
- Record
EUVD-2022-4389- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-jjmc-4p83-pp26
5.9
Logic error in Matrix SDK for Android
A logic error in the room key sharing functionality of Element Android before 1.2.2 and matrix-android-sdk2 (aka Matrix SDK for Android) before 1.2.2 leads to a situation where identity verification is inadequate and thus a key-requesting device can be impersonated.
- Record
GHSA-jjmc-4p83-pp26- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-327
- Updated
- 2026-11-02
OSVALPINE-CVE-2021-40824
5.9
A logic error in the room key sharing functionality of Element Android before 1.2.2 and matrix-android-sdk2 (aka Matrix SDK for Android) before 1.2.2 allows a malicious Matrix homeserver present in an encrypted room to steal room encryption keys (via crafted Matrix protocol messages) that were originally sent by affected Matrix clients participating in that room. This allows the attacker to decrypt end-to-end encrypted messages sent by affected clients.
- Record
ALPINE-CVE-2021-40824- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-03
OSV
5.9
A logic error in the room key sharing functionality of Element Android before 1.2.2 and matrix-android-sdk2 (aka Matrix SDK for Android) before 1.2.2 allows a malicious Matrix homeserver present in an encrypted room to steal room encryption keys (via crafted Matrix protocol messages) that were originally sent by affected Matrix clients participating in that room. This allows the attacker to decrypt end-to-end encrypted messages sent by affected clients.
- Record
CVE-2021-40824- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-04
OSVGHSA-jjmc-4p83-pp26
5.9
Logic error in Matrix SDK for Android
A logic error in the room key sharing functionality of Element Android before 1.2.2 and matrix-android-sdk2 (aka Matrix SDK for Android) before 1.2.2 leads to a situation where identity verification is inadequate and thus a key-requesting device can be impersonated.
- Record
GHSA-jjmc-4p83-pp26- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-327
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
org.matrix.android:matrix-android-sdk2Maven |
before 1.2.2 | 1.2.2 |
element-webAlpine:v3.18 |
before 1.8.4-r0 | 1.8.4-r0 |
element-webAlpine:v3.19 |
before 1.8.4-r0 | 1.8.4-r0 |
element-webAlpine:v3.20 |
before 1.8.4-r0 | 1.8.4-r0 |
element-webAlpine:v3.21 |
before 1.8.4-r0 | 1.8.4-r0 |
element-webAlpine:v3.22 |
before 1.8.4-r0 | 1.8.4-r0 |
element-webAlpine:v3.23 |
before 1.8.4-r0 | 1.8.4-r0 |
element-webAlpine:v3.24 |
before 1.8.4-r0 | 1.8.4-r0 |
riot-webAlpine:v3.14 |
before 1.8.4-r0 | 1.8.4-r0 |
riot-webAlpine:v3.15 |
before 1.8.4-r0 | 1.8.4-r0 |
riot-webAlpine:v3.16 |
before 1.8.4-r0 | 1.8.4-r0 |
riot-webAlpine:v3.17 |
before 1.8.4-r0 | 1.8.4-r0 |
org.matrix.android:matrix-android-sdk2Maven |
before 1.2.2, plus listed versions 0.0.21.2.1 |
1.2.2 |
History
| Recorded | Changed | Sources |
|---|---|---|
| facts | OSV | |
| affected, aliases, references | OSV | |
| aliases | EUVD, OSV | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-40824 is a medium vulnerability (CVSS 5.9) in Matrix Element, published September 13, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.66%, the 51st percentile. Fixed in org.matrix.android:matrix-android-sdk2 1.2.2.