# CVE-2021-40823: matrix-js-sdk can be tricked into disclosing E2EE room keys to a participating homeserver

- 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:45:50.000Z
- Modified: 2026-06-17T04:07:28.937Z
- Also known as: GHSA-23cm-x6j7-6hq3
- Weaknesses: CWE-200, CWE-290, CWE-327
- Assigned by: mitre

## Description

A logic error in the room key sharing functionality of matrix-js-sdk (aka Matrix Javascript SDK) before 12.4.1 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 homeserver to decrypt end-to-end encrypted messages sent by affected clients.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- matrix-js-sdk (npm): before 12.4.1
- matrix javascript_sdk: before 12.4.1

## 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://github.com/matrix-org/matrix-js-sdk/releases/tag/v12.4.1> (third-party-advisory, web)
- <https://matrix.org/blog/2021/09/13/vulnerability-disclosure-key-sharing> (vendor-advisory, web)
- <https://github.com/matrix-org/matrix-js-sdk/security/advisories/GHSA-23cm-x6j7-6hq3> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-40823> (advisory)
- <https://github.com/matrix-org/matrix-js-sdk/commit/894c24880da0e1cc81818f51c0db80e3c9fb2be9> (web)
- <https://github.com/matrix-org/matrix-js-sdk> (package)

## Sources

- CVE List: [CVE-2021-40823](https://www.cve.org/CVERecord?id=CVE-2021-40823), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-23cm-x6j7-6hq3](https://github.com/advisories/GHSA-23cm-x6j7-6hq3), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2021-40823](https://nvd.nist.gov/vuln/detail/CVE-2021-40823), Public domain, modified 2026-06-17

---

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