Skip to content

← Actionable
Medium, CVSS 5.9amended

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

CVE-2021-40823GHSA-23cm-x6j7-6hq3

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (matrix-js-sdk 12.4.1), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
5.9 · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
EPSS
  • CVE-2021-40823: 0.66% estimated exploitation activity in the next 30 days; percentile 51.72 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

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 https://github.com/matrix-org/matrix-js-sdk/commit/894c24880da0e1cc81818f51c0db80e3c9fb2be9. 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…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from ghsa record GHSA-23cm-x6j7-6hq3

  2. Revision 1 · created ·

    Published from osv record GHSA-23cm-x6j7-6hq3

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2021-40823

Advisory: matrix-js-sdk can be tricked into disclosing E2EE room keys to a participating homeserver
IDs: CVE-2021-40823, GHSA-23cm-x6j7-6hq3
Record: https://patchnext.com/advisories/cve-2021-40823 (revision 2, source checked 26 Oct 2026, 12:24 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 5.9)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: matrix-js-sdk 12.4.1. A vendor fix does not mean a deployment is fixed.

## Affected components
- npm matrix-js-sdk: affected < 12.4.1; fixed in 12.4.1

## Suggested inspection (read-only)
- `npm ls matrix-js-sdk --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on matrix-js-sdk.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-23cm-x6j7-6hq3 (OSV record GHSA-23cm-x6j7-6hq3 lists affected ranges: npm matrix-js-sdk >=0 <12.4.1 (fixed))
- Verified: https://github.com/advisories/GHSA-23cm-x6j7-6hq3 (GitHub-reviewed advisory GHSA-23cm-x6j7-6hq3 lists affected ranges: npm matrix-js-sdk >=0 <12.4.1)

Commands are suggestions: review each one before running it.

Loading voting…