CVE-2022-39251
Matrix Javascript SDK vulnerable to Olm/Megolm protocol confusion
Reported by github_m · Published September 28, 2022
matrix-js-sdk is fixed in 19.7.0 (npm)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| matrix-js-sdk | npm | 19.7.0 |
| riot-web | Alpine | 1.11.7-r0 |
| javascript_sdk | matrix | 19.7.0 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| matrix-org | matrix-js-sdk | < 19.7.0 |
| alpine | riot-web | 0 |
| matrix-org | matrix-js-sdk | 0 |
| alpine | element-web | 0 |
| npm | matrix-js-sdk | 0 |
| amazon:2 | thunderbird | 0 |
Timeline
- Sep 28, 2022 CVE Published
- Sep 29, 2022 EPSS Score (30 in total, the first dated here)
- Sep 29, 2022 PoC Published (2 in total, the first dated here)
- Mar 9, 2026 Security Advisory (9 in total, the first dated here)
- Mar 17, 2026 Distribution Patch (7 in total, the first dated here)
- Jun 17, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2022-39251
vulnetix vdb fixes CVE-2022-39251
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-39251/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- GLSA-202210-35 vendor-advisory
- https://nvd.nist.gov/vuln/detail/CVE-2022-39251 advisory
- https://github.com/advisories/GHSA-r48r-j8fx-mq2c advisory