Skip to content

matrix-js-sdk can be tricked into disclosing E2EE room keys to a participating homeserver

Moderate severity GitHub Reviewed Published Sep 14, 2021 in matrix-org/matrix-js-sdk • Updated Aug 8, 2023

Package

npm matrix-js-sdk (npm)

Affected versions

< 12.4.1

Patched versions

12.4.1

Description

Impact

A logic error in the room key sharing functionality of matrix-js-sdk before 12.4.1 allows a malicious Matrix homeserver† participating in an encrypted room to steal room encryption keys from affected Matrix clients participating in that room. This allows the homeserver to decrypt end-to-end encrypted messages sent by affected clients.

† Or anyone with access to the account of the original recipient of an encrypted message.

Known clients affected (via their use of vulnerable versions of matrix-js-sdk):

  • Element Web (1.8.2 and earlier)
  • Element Desktop (1.8.2 and earlier)
  • SchildiChat Web (1.7.32-sc1 and earlier)
  • SchildiChat Desktop (1.7.32-sc1 and earlier)
  • Cinny (1.2.0 and earlier)

Patch

This was fixed in matrix-org/matrix-js-sdk@894c248.

Workarounds

To prevent a homeserver from being able to steal the room keys, vulnerable clients can be taken offline or signed out. If signing out, care should be taken to either set up Secure Backup or export E2E room keys in order to preserve access to past messages.

References

Published by the National Vulnerability Database Sep 13, 2021
@dbkr dbkr published to matrix-org/matrix-js-sdk Sep 14, 2021
Reviewed Sep 14, 2021
Published to the GitHub Advisory Database Sep 14, 2021
Last updated Aug 8, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

EPSS score

0.084%
(37th percentile)

CVE ID

CVE-2021-40823

GHSA ID

GHSA-23cm-x6j7-6hq3

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.