Resource Exhaustion Vulnerability in Matrix Synapse (CVE-2021-21393)

matrix-synapse Updated 02 Oct 2025

Summary

12/04/2021
N/A
Yes i
Medium
6.5

CVE-2021-21393: Synapse is a Matrix reference homeserver written in python (pypi package matrix-synapse). Affects matrix-synapse across 2 version ranges.

< 1.28.0-1 < 2756517f7a6e17d2403de44981569dc18329315b

Fixed in 1.28.0-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 Synapse is a reference homeserver for the Matrix protocol, which facilitates open federated instant messaging and VoIP services. Written in Python, it allows users to communicate across different platforms while maintaining privacy and security. The package is widely used for its scalability and flexibility, but it has a vulnerability that can lead to resource exhaustion due to improper input validation.

Vulnerability Detail

The vulnerability identified as CVE-2021-21393 exists in Matrix Synapse versions prior to 1.28.0. It arises from the lack of input validation on certain parameters in endpoints that confirm third-party identifiers. This oversight can lead to excessive consumption of disk space and memory, potentially causing the server to become unresponsive or crash. The issue is exacerbated by the arbitrary maximum lengths set for these identifiers, which may not be respected by all clients, leading to unpredictable behavior.

How To Fix

Minimum fixed version

1.28.0-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, you can limit the input size for third-party identifiers by configuring your server settings to enforce stricter validation rules. However, this is not a permanent solution and upgrading is strongly recommended.

Conclusion

CVE-2021-21393 is a significant vulnerability in Matrix Synapse that can lead to resource exhaustion. It is crucial for users to upgrade to version 1.28.0 or later to mitigate this risk. Temporary workarounds can be implemented, but they are not substitutes for a proper upgrade.

See every vulnerability recorded for matrix-synapse →

Share this vulnerability

FAQ

CVE-2021-21393 is a vulnerability in Matrix Synapse that allows for resource exhaustion due to improper input validation.

If exploited, this vulnerability can lead to excessive disk space and memory usage, potentially causing the server to crash or become unresponsive.

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

The CVSS score for CVE-2021-21393 is 6.5, indicating a moderate level of severity.

As a temporary measure, you can implement stricter input validation rules in your server settings to limit the size of third-party identifiers.

Related vulnerabilities

Recent vulnerabilities recorded for matrix-synapse.

How To Fix

Minimum fixed version

1.28.0-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