VDB

CVE-2022-39251

CVE-2022-39251 PUBLISHED CVSS 8.6 HIGH

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.

PackageEcosystemFixed in
matrix-js-sdknpm19.7.0
riot-webAlpine1.11.7-r0
javascript_sdkmatrix19.7.0

Risk scores

CVSS 3.1
8.6
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N

Affected products

VendorProductVersions
matrix-orgmatrix-js-sdk< 19.7.0
alpineriot-web0
matrix-orgmatrix-js-sdk0
alpineelement-web0
npmmatrix-js-sdk0
amazon:2thunderbird0

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

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›