CVE-2024-47080 matrix-js-sdk keys sent via `sendSharedHistoryKeys` vulnerable to interception by malicious homeserver

High 8.7 Published Updated

A malicious homeserver can intercept historical message keys sent by the Matrix JavaScript SDK when using the legacy crypto stack, exposing past encrypted messages.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-47080?

CVE-2024-47080 is a high-severity vulnerability in matrix-org matrix-js-sdk, published on 15 Oct 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

matrix-js-sdk is the Matrix Client-Server SDK for JavaScript and TypeScript. In matrix-js-sdk versions versions 9.11.0 through 34.7.0, the method `MatrixClient.sendSharedHistoryKeys` is vulnerable to interception by malicious homeservers. The method was introduced by MSC3061) and is commonly used to share historical message keys with newly invited users, granting them access to past messages in the room. However, it unconditionally sends these "shared" keys to all of the invited user's devices, regardless of whether the user's cryptographic identity is verified or whether the user's devices are signed by that identity. This allows the attacker to potentially inject its own devices to receive sensitive historical keys without proper security checks. Note that this only affects clients running the SDK with the legacy crypto stack. Clients using the new Rust cryptography stack (i.e. those that call `MatrixClient.initRustCrypto()` instead of `MatrixClient.initCrypto()`) are unaffected by this vulnerability, because `MatrixClient.sendSharedHistoryKeys()` raises an exception in such environments. The vulnerability was fixed in matrix-js-sdk 34.8.0 by removing the vulnerable functionality. As a workaround, remove use of affected functionality from clients.

Weakness: CWE-287, CWE-200

Which versions are affected by CVE-2024-47080?

2 open source packages ship an affected version, including matrix-js-sdk.

PackageAffectedFixed in
matrix-js-sdk npmFrom 9.11.034.8.0
matrix-js-sdk npmFrom 9.11.034.8.0

How do I fix CVE-2024-47080?

Upgrade matrix-js-sdk to 34.8.0 or later.

Is CVE-2024-47080 being exploited?

There is no known exploitation of CVE-2024-47080 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2024-47080, GHSA-4jf8-g8wp-cx7c, UBUNTU-CVE-2024-47080.

Is CVE-2024-47080 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free