Security advisory
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2021-40823
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 11:20 UTC · Revision 1
Source evidence
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.
osv:CVE-2021-40823
Complete source record
{
"id": "313f04d41fc17794b33a65737a8323fd3cbc22e7252059e5652303370cea850b",
"url": "https://osv.dev/vulnerability/CVE-2021-40823",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2021-40823",
"summary": "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.",
"evidence": "osv:CVE-2021-40823",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2021-40823",
"aliases": [
"CVE-2021-40823",
"GHSA-23cm-x6j7-6hq3"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/matrix-org/matrix-js-sdk",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "e878b7683b1d7b47eca10d8dfc4510f7826679b3"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:matrix:javascript_sdk:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "12.4.1"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "e878b7683b1d7b47eca10d8dfc4510f7826679b3"
}
],
"source": "REFERENCES_TAG",
"original_tag": "v12.4.1"
}
]
}
}
],
"versions": [
"v12.4.0",
"v12.4.0-rc.1",
"v8.1.0",
"v8.1.0-rc.1",
"v8.0.0",
"v7.1.0",
"v7.1.0-rc.1",
"v5.0.1",
"v2.4.1",
"v2.0.1",
"v2.0.1-rc.2",
"v2.0.1-rc.1",
"v1.0.0",
"v1.0.0-rc.2",
"v1.0.0-rc.1",
"v0.11.0",
"v0.11.0-rc.1",
"v0.10.7",
"v0.10.7-rc.1",
"v0.10.5",
"v0.10.5-rc.1",
"v0.10.3",
"v0.10.2",
"v0.10.3-rc.1",
"v0.10.2-rc.1",
"v0.8.3",
"v0.8.3-rc.1",
"v0.8.2",
"v0.8.1",
"v0.8.1-rc.1",
"v0.8.0",
"v0.7.10",
"v0.7.9",
"v0.7.4",
"v0.7.4-rc.1",
"v0.7.2",
"v0.7.1-rc.1",
"v0.6.4",
"v0.6.4-rc.2",
"v0.6.2",
"v0.6.1",
"v0.6.0-rc2",
"v0.6.0-rc1",
"v0.5.6",
"v0.5.5",
"v0.5.4",
"v0.5.3",
"v0.5.2",
"v0.5.1",
"v0.5.0",
"v0.4.2",
"v0.4.1",
"v0.2.2",
"v0.2.1",
"v0.2.0",
"v0.1.1",
"v0.1.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-40823.json"
}
}
],
"modified": "2026-10-20T10:53:58.126358438Z",
"provider": "osv",
"references": [
"https://github.com/matrix-org/matrix-js-sdk/releases/tag/v12.4.1",
"https://matrix.org/blog/2021/09/13/vulnerability-disclosure-key-sharing"
],
"provider_metadata": {}
},
"related_cves": [
{
"value": "CVE-2021-40823",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 384793,
"published_at": "2021-09-13T19:15:19.137+00:00"
}