Matrix Javascript SDK Vulnerability: Message Spoofing via Malicious Homeserver

node-matrix-js-sdk Updated 02 Oct 2025

Summary

28/09/2022
N/A
No i
High
7.5

CVE-2022-39251: Matrix Javascript SDK is the Matrix Client-Server SDK for JavaScript. Affects node-matrix-js-sdk across 2 version ranges.

< 2d067ad95778b26aed24b801be0951e215c3ac8c < a587d7c36026fe1fcf93dfff63588abee359be76

No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The Matrix Javascript SDK is a client-server SDK designed for building applications that communicate over the Matrix protocol. It enables developers to create real-time communication applications, supporting features like messaging, presence, and synchronization. However, prior to version 19.7.0, the SDK was vulnerable to a protocol confusion issue that allowed attackers to spoof messages from other users when cooperating with a malicious homeserver.

Vulnerability Detail

The vulnerability arises from a protocol confusion that allows to-device messages encrypted with Megolm to be accepted instead of the intended Olm encryption. This flaw can be exploited by an attacker working with a malicious homeserver to craft messages that appear to originate from another user, potentially leading to targeted attacks. Such attacks could include injecting key backup secrets during self-verification, allowing the attacker to manipulate the key backup process and compromise user security.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

There are no specific workarounds mentioned for this vulnerability. However, users are advised to ensure they trust their homeserver and to upgrade to the latest version of the SDK as soon as possible to avoid potential exploitation.

Conclusion

The Matrix Javascript SDK vulnerability (CVE-2022-39251) poses significant risks due to its ability to allow message spoofing through a malicious homeserver. Users are strongly encouraged to upgrade to version 19.7.0 or later to mitigate these risks and ensure the security of their applications.

See every vulnerability recorded for node-matrix-js-sdk →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

Versions prior to 19.7.0 of the Matrix Javascript SDK are affected by this vulnerability.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

While there are no specific workarounds, it is crucial to ensure that you trust your homeserver until you can upgrade to a secure version.

Exploitation of this vulnerability can lead to message spoofing, allowing attackers to send fake messages or manipulate key backup processes, compromising user security.

Related vulnerabilities

Recent vulnerabilities recorded for node-matrix-js-sdk.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback