Skip to content
Noroxi
CVE-2022-39249· NVD / CVE Program· CNA GitHub_M

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.

HighCVSS 7.5 · v3.1—No exploit Fix available
Published
Sep 28, 2022
Updated
Jun 17, 2026
EPSS
1.3% · 69th percentile
Follow this CVE

Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.

Report tools

JSON

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 help

Affected systems

VendorProduct
matrixjavascript 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.

EcosystemPackageAffected rangeFix
AlmaLinux:8thunderbirdbefore 102.4.0-1.el8_6.alma102.4.0-1.el8_6.alma
AlmaLinux:9thunderbirdbefore 102.4.0-1.el9_0.alma102.4.0-1.el9_0.alma
Debian:11node-matrix-js-sdkall versions—
npmmatrix-js-sdkbefore 19.7.019.7.0
openSUSE:Tumbleweedelement-desktopbefore 1.11.8-1.11.11.8-1.1
openSUSE:Tumbleweedelement-webbefore 1.11.8-1.11.11.8-1.1
openSUSE:TumbleweedMozillaThunderbirdbefore 102.3.1-1.1102.3.1-1.1
Red Hat:enterprise_linux:7::clientthunderbirdbefore 0:102.4.0-1.el7_90:102.4.0-1.el7_9
Red Hat:enterprise_linux:7::clientthunderbird-debuginfobefore 0:102.4.0-1.el7_90:102.4.0-1.el7_9
Red Hat:enterprise_linux:8::appstreamthunderbirdbefore 0:102.4.0-1.el8_60:102.4.0-1.el8_6
Red Hat:enterprise_linux:8::appstreamthunderbird-debuginfobefore 0:102.4.0-1.el8_60:102.4.0-1.el8_6
Red Hat:enterprise_linux:8::appstreamthunderbird-debugsourcebefore 0:102.4.0-1.el8_60:102.4.0-1.el8_6
Red Hat:enterprise_linux:9::appstreamthunderbirdbefore 0:102.4.0-1.el9_00:102.4.0-1.el9_0
Red Hat:enterprise_linux:9::appstreamthunderbird-debuginfobefore 0:102.4.0-1.el9_00:102.4.0-1.el9_0
Red Hat:enterprise_linux:9::appstreamthunderbird-debugsourcebefore 0:102.4.0-1.el9_00:102.4.0-1.el9_0
Red Hat:rhel_e4s:8.1::appstreamthunderbirdbefore 0:102.4.0-1.el8_10:102.4.0-1.el8_1
Red Hat:rhel_e4s:8.1::appstreamthunderbird-debuginfobefore 0:102.4.0-1.el8_10:102.4.0-1.el8_1
Red Hat:rhel_e4s:8.1::appstreamthunderbird-debugsourcebefore 0:102.4.0-1.el8_10:102.4.0-1.el8_1
Red Hat:rhel_eus:8.2::appstreamthunderbirdbefore 0:102.4.0-1.el8_20:102.4.0-1.el8_2
Red Hat:rhel_eus:8.2::appstreamthunderbird-debuginfobefore 0:102.4.0-1.el8_20:102.4.0-1.el8_2
Red Hat:rhel_eus:8.2::appstreamthunderbird-debugsourcebefore 0:102.4.0-1.el8_20:102.4.0-1.el8_2
Red Hat:rhel_eus:8.4::appstreamthunderbirdbefore 0:102.4.0-1.el8_40:102.4.0-1.el8_4
Red Hat:rhel_eus:8.4::appstreamthunderbird-debuginfobefore 0:102.4.0-1.el8_40:102.4.0-1.el8_4
Red Hat:rhel_eus:8.4::appstreamthunderbird-debugsourcebefore 0:102.4.0-1.el8_40:102.4.0-1.el8_4

+4

Other highest-scoring records for the same primary product.

  • CVE-2023-28427Prototype pollution in matrix-js-sdk
    32Monitor
  • CVE-2022-39250Matrix JavaScript SDK vulnerable to key/device identifier confusion in SAS verification
    30Monitor
  • CVE-2022-39251Matrix Javascript SDK vulnerable to Olm/Megolm protocol confusion
    30Monitor
  • 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 hom
    23Monitor
  • CVE-2024-42369A room with itself as a its predecessor will freeze matrix-js-sdk
    21Monitor
  • CVE-2023-29529matrix-js-sdk vulnerable to invisible eavesdropping in group calls
    21Monitor

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
almalinux:thunderbird102.4.0-1.el9_0.alma · AlmaLinux:9Package registry (OSV)
npm:matrix-js-sdk19.7.0Package registry (OSV)
opensuse:element-desktop1.11.8-1.1 · openSUSE:TumbleweedPackage registry (OSV)
opensuse:element-web1.11.8-1.1 · openSUSE:TumbleweedPackage registry (OSV)
opensuse:MozillaThunderbird102.4.0-150200.8.85.1 · openSUSE:Leap 15.3Package registry (OSV)
red hat:thunderbird0:102.4.0-1.el9_0 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:thunderbird-debuginfo0:102.4.0-1.el9_0 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:thunderbird-debugsource0:102.4.0-1.el9_0 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
rocky linux:thunderbird0:102.4.0-1.el8_6 · Rocky Linux:8Package registry (OSV)
suse:MozillaThunderbird102.4.0-150200.8.85.1 · SUSE:Linux Enterprise Module for Package Hub 15 SP3Package 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.

EPSS, last 120 days

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.

Finders, 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

CVSS 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.

A representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.

Vulnerable

ts
app.use("/admin", requireSession, adminRouter);
// Route added later skips the middlewareapp.post("/admin-api/config", updateConfig);

Fixed

ts
const admin = express.Router();admin.use(requireSession, requireRole("admin"));
admin.post("/config", updateConfig);app.use("/admin", admin);

Change log

  1. Fix✗ → ✓

For records you follow, these changes also arrive as notifications. →

References

All records