Unauthorized Access to Room Membership in Matrix Synapse - CVE-2021-39164

matrix-synapse Updated 02 Oct 2025

Summary

31/08/2021
N/A
Yes i
Low
3.1

CVE-2021-39164: Matrix is an ecosystem for open federated Instant Messaging and Voice over IP. Affects matrix-synapse across 2 version ranges.

< 1.41.1-1 < cb35df940a

Fixed in 1.41.1-1. 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

Matrix is an open federated Instant Messaging and Voice over IP ecosystem that allows users to communicate across different platforms. The package 'matrix-synapse' serves as the reference homeserver implementation for the Matrix protocol, enabling users to create and manage rooms for communication. This package is designed to support various features such as group chats, voice calls, and more. However, it has a vulnerability that allows unauthorized users to access sensitive information about room memberships under specific conditions.

Vulnerability Detail

In versions 1.41.0 and prior of matrix-synapse, a vulnerability exists that allows unauthorized users to access the membership list of a room if they know the room's ID. This issue is particularly concerning for rooms with 'shared' history visibility, as it exposes the display names of members to users who should not have access. The vulnerability arises from insufficient access controls implemented in the homeserver, which can lead to privacy breaches and unauthorized information disclosure.

How To Fix

Minimum fixed version

1.41.1-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade matrix-synapse

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, administrators of servers that utilize a reverse proxy can block access to specific endpoints. This can be done by configuring the reverse proxy to deny requests to the following URLs:

  1. /_matrix/client/r0/rooms/{room_id}/members with 'at' query parameter
  2. /_matrix/client/unstable/rooms/{room_id}/members with 'at' query parameter. This approach may lead to a loss of functionality, so it should be considered a short-term solution until the upgrade is completed.

Conclusion

CVE-2021-39164 represents a significant security concern for users of the matrix-synapse package, allowing unauthorized access to room membership information. It is crucial for server administrators to upgrade to version 1.41.1 or later to mitigate this risk. Temporary workarounds can be employed, but they should not replace a proper update.

See every vulnerability recorded for matrix-synapse →

Share this vulnerability

FAQ

CVE-2021-39164 is a vulnerability in the matrix-synapse package that allows unauthorized users to access the membership list of a room if they know the room ID.

Versions 1.41.0 and prior of matrix-synapse are affected by this vulnerability.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without requiring any signup.

The CVSS score of CVE-2021-39164 is 3.1, indicating a low to moderate severity level.

If an immediate upgrade is not possible, consider implementing the mentioned workaround to block access to the vulnerable endpoints until you can perform the upgrade.

Related vulnerabilities

Recent vulnerabilities recorded for matrix-synapse.

How To Fix

Minimum fixed version

1.41.1-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade matrix-synapse

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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