# CVE-2022-39251: Matrix Javascript SDK vulnerable to Olm/Megolm protocol confusion

- Priority: **Prioritise**
- Reason: Severe, CVSS 8.6 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 1% (FIRST, 04-12-2026)
- Next step: Check applicability and the vendor advisory: no fix release is recorded here
- Status: published
- Published: 2022-09-28 · Modified: 2025-04-23
- Aliases: UBUNTU-CVE-2022-39251, DEBIAN-CVE-2022-39251, GHSA-r48r-j8fx-mq2c, ALPINE-CVE-2022-39251
- Record: https://cvemate.com/vulnerability/CVE-2022-39251 · JSON: https://cvemate.com/vulnerability/CVE-2022-39251/json

## Description

```text
Matrix Javascript SDK is the Matrix Client-Server SDK for JavaScript. Prior to version 19.7.0, an attacker cooperating with a malicious homeserver can construct messages that legitimately appear to have come from another person, without any indication such as a grey shield. Additionally, a sophisticated attacker cooperating with a malicious homeserver could employ this vulnerability to perform a targeted attack in order to send fake to-device messages appearing to originate from another user. This can allow, for example, to inject the key backup secret during a self-verification, to make a targeted device start using a malicious key backup spoofed by the homeserver. These attacks are possible due to a protocol confusion vulnerability that accepts to-device messages encrypted with Megolm instead of Olm. Starting with version 19.7.0, matrix-js-sdk has been modified to only accept Olm-encrypted to-device messages. Out of caution, several other checks have been audited or added. This attack requires coordination between a malicious home server and an attacker, so those who trust their home servers do not need a workaround.
```

## Signals

- CVSS: 8.6 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
- EPSS: 1.202%, percentile 69.239%, 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.11.7-r0
- alpine riot-web (Alpine Linux): \< 1.11.7-r0
- debian node-matrix-js-sdk (Debian): All versions (No fix recorded)
- ubuntu node-matrix-js-sdk (Ubuntu): All versions (No fix recorded)
- ubuntu thunderbird (Ubuntu): \< 1:102.4.2+build2-0ubuntu0.18.04.1 \| \< 1:102.4.2+build2-0ubuntu0.20.04.1 \| \< 1:102.4.2+build2-0ubuntu0.22.04.1
- matrix-org matrix-js-sdk: \< 19.7.0
- matrix javascript\_sdk: \< 19.7.0
- Npm matrix-js-sdk (Npm): \< 19.7.0

## References

- <https://github.com/matrix-org/matrix-js-sdk/commit/a587d7c36026fe1fcf93dfff63588abee359be76>
- <https://github.com/matrix-org/matrix-js-sdk/releases/tag/v19.7.0>
- <https://matrix.org/blog/2022/09/28/upgrade-now-to-address-encryption-vulns-in-matrix-sdks-and-clients>
- <https://github.com/matrix-org/matrix-js-sdk/security/advisories/GHSA-r48r-j8fx-mq2c>
- <https://security.gentoo.org/glsa/202210-35>
- <https://ubuntu.com/security/CVE-2022-39251>
- <https://ubuntu.com/security/notices/USN-5724-1>
- <https://www.cve.org/CVERecord?id=CVE-2022-39251>
- <https://security-tracker.debian.org/tracker/CVE-2022-39251>
- <https://nvd.nist.gov/vuln/detail/CVE-2022-39251>
- <https://github.com/matrix-org/matrix-js-sdk>
- <https://security.alpinelinux.org/vuln/CVE-2022-39251>

---

Data as of 2026-12-05T05:06:04.529Z. 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
