# CVE-2021-40823

- Priority: **Routine**
- Reason: Not severe (CVSS 5.9, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2021-09-13 · Modified: 2024-08-04
- Aliases: UBUNTU-CVE-2021-40823, DEBIAN-CVE-2021-40823, GHSA-23cm-x6j7-6hq3, ALPINE-CVE-2021-40823
- Record: https://cvemate.com/vulnerability/CVE-2021-40823 · JSON: https://cvemate.com/vulnerability/CVE-2021-40823/json

## Description

```text
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.
```

## Signals

- CVSS: 5.9 medium (v3.1, NVD) CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
- EPSS: 0.662%, percentile 53.067%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine element-web (Alpine Linux): \< 1.8.4-r0
- alpine riot-web (Alpine Linux): \< 1.8.4-r0
- debian node-matrix-js-sdk (Debian): All versions (No fix recorded)
- ubuntu node-matrix-js-sdk (Ubuntu): All versions (No fix recorded)
- matrix javascript\_sdk: \< 12.4.1
- Npm matrix-js-sdk (Npm): \< 12.4.1

## References

- <https://github.com/matrix-org/matrix-js-sdk/releases/tag/v12.4.1>
- <https://matrix.org/blog/2021/09/13/vulnerability-disclosure-key-sharing>
- <https://ubuntu.com/security/CVE-2021-40823>
- <https://matrix.org/blog/2021/09/13/vulnerability-disclosure-key-sharing/>
- <https://github.com/matrix-org/matrix-js-sdk/commit/894c24880da0e1cc81818f51c0db80e3c9fb2be9>
- <https://www.cve.org/CVERecord?id=CVE-2021-40823>
- <https://security-tracker.debian.org/tracker/CVE-2021-40823>
- <https://github.com/matrix-org/matrix-js-sdk/security/advisories/GHSA-23cm-x6j7-6hq3>
- <https://nvd.nist.gov/vuln/detail/CVE-2021-40823>
- <https://github.com/matrix-org/matrix-js-sdk>
- <https://security.alpinelinux.org/vuln/CVE-2021-40823>

---

Data as of 2026-12-05T06:33:44.035Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
