8.7high
matrix-js-sdk keys sent via `sendSharedHistoryKeys` vulnerable to interception by malicious homeserver
- Severity
- 8.7high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.68% (higher than 53% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-4jf8-g8wp-cx7c
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| matrix-org matrix-js-sdk | >= 9.11.0, < 34.8.0 | CVE List |
| matrix-js-sdk (npm) | from 9.11.0 before 34.8.0 | GitHub Advisory Database |
All scores
| GitHub_M | 8.7high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
Impact
In matrix-js-sdk versions 9.11.0 through 34.7.0, the method MatrixClient.sendSharedHistoryKeys is vulnerable to interception by malicious homeservers. The method implements functionality proposed in MSC3061 and can be used by clients 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.
Patches
Fixed in matrix-js-sdk 34.8.0 by removing the vulnerable functionality.
Workarounds
Remove use of affected functionality from clients.
References
For more information
If you have any questions or comments about this advisory, please email us at security at matrix.org.
NVD (es)
matrix-js-sdk es el SDK de Matrix Client-Server para JavaScript y TypeScript. En las versiones 9.11.0 a 34.7.0 de matrix-js-sdk, el método `MatrixClient.sendSharedHistoryKeys` es vulnerable a la intercepción por parte de servidores domésticos maliciosos. El método fue introducido por MSC3061) y se utiliza comúnmente para compartir claves de mensajes históricos con usuarios recién invitados, otorgándoles acceso a mensajes anteriores en la sala. Sin embargo, envía incondicionalmente estas claves "compartidas" a todos los dispositivos del usuario invitado, independientemente de si la identidad criptográfica del usuario está verificada o si los dispositivos del usuario están firmados por esa identidad. Esto permite al atacante inyectar potencialmente sus propios dispositivos para recibir claves históricas confidenciales sin los controles de seguridad adecuados. Tenga en cuenta que esto solo afecta a los clientes que ejecutan el SDK con la pila criptográfica heredada. Los clientes que utilizan la nueva pila de criptografía de Rust (es decir, aquellos que llaman a `MatrixClient.initRustCrypto()` en lugar de `MatrixClient.initCrypto()`) no se ven afectados por esta vulnerabilidad, porque `MatrixClient.sendSharedHistoryKeys()` genera una excepción en dichos entornos. La vulnerabilidad se solucionó en matrix-js-sdk 34.8.0 eliminando la funcionalidad vulnerable. Como workaround, elimine el uso de la funcionalidad afectada de los clientes.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-47080 changed 2024-10-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-4jf8-g8wp-cx7c changed 2024-10-15 | CC-BY-4.0 |
| NVD | CVE-2024-47080 changed 2026-06-17 | Public domain |