CVE-2021-40823

A logic error in the room key sharing functionality of matrix-js-sdk (aka Matrix Javascript SDK) before 12.4.1 allows a malicious Matrix homeserver present in an encrypted room to steal room encryption keys (via crafted Matrix protocol messages) that were originally sent by affected Matrix clients participating in that room. This allows the homeserver to decrypt end-to-end encrypted messages sent by affected clients.

Published: 2021-09-13 Last update: 2024-11-21 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2021-40823 is rated Low Risk (36.3/100): CVSS Medium severity, with low exploitation likelihood (EPSS 0.16%). Mandatory action: Monitor for updates and reassess as exploit intelligence or EPSS changes.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2021-40823

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-05-26 0.26% 0.16% -0.10%
2 2025-11-21 0.16% 0.26% +0.10%
3 2025-11-18 0.16%

Full EPSS history (12 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2021-40823

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
5.9 3.1 MEDIUM
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:N)
Service keeps running; no real outage angle.
2.2 3.6 [email protected]
4.3 2.0 MEDIUM
AV:N/AC:M/Au:N/C:P/I:N/A:N Click to expand
Access vector (AV:N)
Can be exploited remotely over network reachability.
Access complexity (AC:M)
Exploitation needs some favorable conditions, but not exceptional ones.
Authentication (AU:N)
No authentication is required.
Confidentiality impact (C:P)
Partial confidentiality impact.
Integrity impact (I:N)
No integrity impact.
Availability impact (A:N)
No availability impact.
8.6 2.9 [email protected]

Weakness enumeration for CVE-2021-40823

GitHub Security Advisory for CVE-2021-40823

GHSA-23cm-x6j7-6hq3 · Severity: medium · Ecosystem: npm — matrix-js-sdk can be tricked into disclosing E2EE room keys to a participating homeserver

OS Trackers for CVE-2021-40823

vendor priority summary link
alpine medium CVE-2021-40823: 2 source package rows (element-web, riot-web); 8 state rows across 7 repos (3.17-community, 3.18-community, 3.19-community, 3.20-community, 3.21-community, 3.22-community, edge-community); fixed 8, open 0. https://security.alpinelinux.org/vuln/CVE-2021-40823
debian not yet assigned CVE-2021-40823 not yet assigned priority: Debian including 1 source packages (node-matrix-js-sdk), 1 status rows across 1 suites (bullseye): open 1. https://security-tracker.debian.org/tracker/CVE-2021-40823
ubuntu medium CVE-2021-40823 medium priority: Ubuntu including 2 source packages (element-web, node-matrix-js-sdk), 30 status rows across 15 suites (bionic, focal, hirsute, impish, jammy, kinetic, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): DNE 17, ignored 8, needs-triage 5. https://ubuntu.com/security/CVE-2021-40823

Affected software / configurations for CVE-2021-40823

Vendor Product Version Raw CPE
matrix javascript_sdk < 12.4.1 cpe:2.3:a:matrix:javascript_sdk:*:*:*:*:*:*:*:*

References for CVE-2021-40823

cvelogic Threat Intelligence