Matrix Javascript SDK vulnerable to impersonation via forwarded Megolm sessions
Matrix Javascript SDK is the Matrix Client-Server SDK for JavaScript. Prior to version 19.7.0, an attacker cooperating with a malicious homeserver can construct messages appearing to have come from another person. Such messages will be marked with a grey shield on some platforms, but this may be missing in others. This attack is possible due to the matrix-js-sdk implementing a too permissive key forwarding strategy on the receiving end. Starting with version 19.7.0, the default policy for accepting key forwards has been made more strict in the matrix-js-sdk. matrix-js-sdk will now only accept forwarded keys in response to previously issued requests and only from own, verified devices. The SDK now sets a `trusted` flag on the decrypted message upon decryption, based on whether the key used to decrypt the message was received from a trusted source. Clients need to ensure that messages decrypted with a key with `trusted = false` are decorated appropriately, for example, by showing a warning for such messages. This attack requires coordination between a malicious homeserver and an attacker, and those who trust your homeservers do not need a workaround.
- Published
- Sep 28, 2022
- Updated
- Jun 17, 2026
- EPSS
- 1.3% · 69th percentile
- CWE
- CWE-287
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
Action score
30
Monitor
Low priority for now.
- CVSS
- 30 / 40 · 7.5 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 1.3%
CISA SSVC decision
- Exploitation
- none
- Automatable
- yes
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- 7.5
- CNA · GitHub_M
- 7.5
- agree
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Noroxi analysis
No Noroxi analysis for this record yet
We don't hand-write analysis for the hundreds of thousands of vulnerabilities in the database; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.
We use this product, ask for helpAffected systems
| Vendor | Product | CPE |
|---|---|---|
| matrix | javascript sdk | cpe:2.3:a:matrix:javascript_sdk |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- matrix javascript sdkbefore 19.7.0
Versions reported by the vendor
Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.
matrix-org matrix-js-sdk
- < 19.7.0affected
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| AlmaLinux:8 | thunderbird | before 102.4.0-1.el8_6.alma | 102.4.0-1.el8_6.alma |
| AlmaLinux:9 | thunderbird | before 102.4.0-1.el9_0.alma | 102.4.0-1.el9_0.alma |
| Debian:11 | node-matrix-js-sdk | all versions | — |
| npm | matrix-js-sdk | before 19.7.0 | 19.7.0 |
| openSUSE:Tumbleweed | element-desktop | before 1.11.8-1.1 | 1.11.8-1.1 |
| openSUSE:Tumbleweed | element-web | before 1.11.8-1.1 | 1.11.8-1.1 |
| openSUSE:Tumbleweed | MozillaThunderbird | before 102.3.1-1.1 | 102.3.1-1.1 |
| Red Hat:enterprise_linux:7::client | thunderbird | before 0:102.4.0-1.el7_9 | 0:102.4.0-1.el7_9 |
| Red Hat:enterprise_linux:7::client | thunderbird-debuginfo | before 0:102.4.0-1.el7_9 | 0:102.4.0-1.el7_9 |
| Red Hat:enterprise_linux:8::appstream | thunderbird | before 0:102.4.0-1.el8_6 | 0:102.4.0-1.el8_6 |
| Red Hat:enterprise_linux:8::appstream | thunderbird-debuginfo | before 0:102.4.0-1.el8_6 | 0:102.4.0-1.el8_6 |
| Red Hat:enterprise_linux:8::appstream | thunderbird-debugsource | before 0:102.4.0-1.el8_6 | 0:102.4.0-1.el8_6 |
| Red Hat:enterprise_linux:9::appstream | thunderbird | before 0:102.4.0-1.el9_0 | 0:102.4.0-1.el9_0 |
| Red Hat:enterprise_linux:9::appstream | thunderbird-debuginfo | before 0:102.4.0-1.el9_0 | 0:102.4.0-1.el9_0 |
| Red Hat:enterprise_linux:9::appstream | thunderbird-debugsource | before 0:102.4.0-1.el9_0 | 0:102.4.0-1.el9_0 |
| Red Hat:rhel_e4s:8.1::appstream | thunderbird | before 0:102.4.0-1.el8_1 | 0:102.4.0-1.el8_1 |
| Red Hat:rhel_e4s:8.1::appstream | thunderbird-debuginfo | before 0:102.4.0-1.el8_1 | 0:102.4.0-1.el8_1 |
| Red Hat:rhel_e4s:8.1::appstream | thunderbird-debugsource | before 0:102.4.0-1.el8_1 | 0:102.4.0-1.el8_1 |
| Red Hat:rhel_eus:8.2::appstream | thunderbird | before 0:102.4.0-1.el8_2 | 0:102.4.0-1.el8_2 |
| Red Hat:rhel_eus:8.2::appstream | thunderbird-debuginfo | before 0:102.4.0-1.el8_2 | 0:102.4.0-1.el8_2 |
| Red Hat:rhel_eus:8.2::appstream | thunderbird-debugsource | before 0:102.4.0-1.el8_2 | 0:102.4.0-1.el8_2 |
| Red Hat:rhel_eus:8.4::appstream | thunderbird | before 0:102.4.0-1.el8_4 | 0:102.4.0-1.el8_4 |
| Red Hat:rhel_eus:8.4::appstream | thunderbird-debuginfo | before 0:102.4.0-1.el8_4 | 0:102.4.0-1.el8_4 |
| Red Hat:rhel_eus:8.4::appstream | thunderbird-debugsource | before 0:102.4.0-1.el8_4 | 0:102.4.0-1.el8_4 |
+4
Same product
matrix: all recordsOther highest-scoring records for the same primary product.
- CVE-2023-28427Prototype pollution in matrix-js-sdk32Monitor
- CVE-2022-39250Matrix JavaScript SDK vulnerable to key/device identifier confusion in SAS verification30Monitor
- CVE-2022-39251Matrix Javascript SDK vulnerable to Olm/Megolm protocol confusion30Monitor
- CVE-2021-40823A logic error in the room key sharing functionality of matrix-js-sdk (aka Matrix Javascript SDK) before 12.4.1 allows a malicious Matrix hom23Monitor
- CVE-2024-42369A room with itself as a its predecessor will freeze matrix-js-sdk21Monitor
- CVE-2023-29529matrix-js-sdk vulnerable to invisible eavesdropping in group calls21Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| almalinux:thunderbird | 102.4.0-1.el9_0.alma · AlmaLinux:9 | Package registry (OSV) |
| npm:matrix-js-sdk | 19.7.0 | Package registry (OSV) |
| opensuse:element-desktop | 1.11.8-1.1 · openSUSE:Tumbleweed | Package registry (OSV) |
| opensuse:element-web | 1.11.8-1.1 · openSUSE:Tumbleweed | Package registry (OSV) |
| opensuse:MozillaThunderbird | 102.4.0-150200.8.85.1 · openSUSE:Leap 15.3 | Package registry (OSV) |
| red hat:thunderbird | 0:102.4.0-1.el9_0 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
| red hat:thunderbird-debuginfo | 0:102.4.0-1.el9_0 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
| red hat:thunderbird-debugsource | 0:102.4.0-1.el9_0 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
| rocky linux:thunderbird | 0:102.4.0-1.el8_6 · Rocky Linux:8 | Package registry (OSV) |
| suse:MozillaThunderbird | 102.4.0-150200.8.85.1 · SUSE:Linux Enterprise Module for Package Hub 15 SP3 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- none
- Integrity
- high · data or configuration can be modified
- Availability
- none
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- None
- Integrity impact
- High
- Availability impact
- None
Weakness class (CWE)
CWE-287 · Improper AuthenticationCVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
nvd-primary
Root cause
Authentication is added route by route instead of being enforced in one place. When a route added later bypasses the shared middleware, the session check never runs for it.
The bug in code
The whole CWE-287 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
app.use("/admin", requireSession, adminRouter);
// Route added later skips the middlewareapp.post("/admin-api/config", updateConfig);Fixed
const admin = express.Router();admin.use(requireSession, requireRole("admin"));
admin.post("/config", updateConfig);app.use("/admin", admin);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- Authentication AbuseCAPEC-114Medium
- Authentication BypassCAPEC-115Medium
- Identity SpoofingCAPEC-151likelihood: Medium · Medium
- Fake the Source of DataCAPEC-194Medium
- Exploiting Trust in ClientCAPEC-22likelihood: High · High
- Utilizing REST's Trust in the System Resource to Obtain Sensitive DataCAPEC-57likelihood: Medium · Very High
- Session HijackingCAPEC-593likelihood: High · Very High
- Token ImpersonationCAPEC-633Medium
ATT&CK techniques
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
- github.com/matrix-org/matrix-js-sdk/commit/a587d7c36026fe1fcf93dfff63588abee359be76
- github.com/matrix-org/matrix-js-sdk/releases/tag/v19.7.0
- github.com/matrix-org/matrix-js-sdk/security/advisories/GHSA-6263-x97c-c4gg
- github.com/matrix-org/matrix-spec-proposals/pull/3061
- matrix.org/blog/2022/09/28/upgrade-now-to-address-encryption-vulns-in-matrix-sdks-and-clients
- security.gentoo.org/glsa/202210-35
Vendor advisories and official records. Exploit/PoC links are deliberately left out.