# CVE-2021-40824: Logic error in Matrix SDK for Android

- Severity: Medium 5.9 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.66%, higher than 52% of CVEs (2026-12-01)
- Published: 2021-09-13T18:49:28.000Z
- Modified: 2026-06-17T04:07:29.053Z
- Also known as: GHSA-jjmc-4p83-pp26
- Weaknesses: CWE-290, CWE-327
- Assigned by: mitre

## Description

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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- org.matrix.android:matrix-android-sdk2 (Maven): before 1.2.2
- matrix element: before 1.2.2
- matrix matrix-android-sdk2: before 1.2.2

## Every score

- GitHub: 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`
- NVD: 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`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:P/I:N/A:N`

## References

- <https://matrix.org/blog/2021/09/13/vulnerability-disclosure-key-sharing> (vendor-advisory, web)
- <https://github.com/matrix-org/matrix-android-sdk2/releases/tag/v1.2.2> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-40824> (advisory)

## Sources

- CVE List: [CVE-2021-40824](https://www.cve.org/CVERecord?id=CVE-2021-40824), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-jjmc-4p83-pp26](https://github.com/advisories/GHSA-jjmc-4p83-pp26), CC-BY-4.0, modified 2024-02-16
- NVD: [CVE-2021-40824](https://nvd.nist.gov/vuln/detail/CVE-2021-40824), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-40824 · Whole record: https://cve.day/CVE-2021-40824.json · Rebuilt by cve.day 2026-11-25T22:58:03.916Z
