CVE-2022-39249
Matrix Javascript SDK vulnerable to impersonation via forwarded Megolm sessions
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 appearing to have come from another person. Such messages will be marked with a grey shield on some platforms, but this may be missing in others. This attack is possible due to the matrix-js-sdk implementing a too permissive key forwarding strategy on the receiving end. Starting with version 19.7.0, the default policy for accepting key forwards has been made more strict in the matrix-js-sdk. matrix-js-sdk will now only accept forwarded keys in response to previously issued requests and only from own, verified devices. The SDK now sets a `trusted` flag on the decrypted message upon decryption, based on whether the key used to decrypt the message was received from a trusted source. Clients need to ensure that messages decrypted with a key with `trusted = false` are decorated appropriately, for example, by showing a warning for such messages. This attack requires coordination between a malicious homeserver and an attacker, and those who trust your homeservers 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 |
| thunderbird | Amazon Linux | 102.4.0-1.amzn2.0.1 |
| riot-web | Alpine | 1.11.7-r0 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| matrix-org | matrix-js-sdk | < 19.7.0 |
| amazon:2 | thunderbird | 0 |
| alpine | riot-web | 0 |
| matrix-org | matrix-js-sdk | 0 |
| npm | matrix-js-sdk | 0 |
| alpine | element-web | 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)
- Dec 6, 2022 CVE Updated
- 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-39249
vulnetix vdb fixes CVE-2022-39249
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-39249/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-39249 advisory
- https://github.com/advisories/GHSA-6263-x97c-c4gg advisory