HTML Injection Vulnerability in Matrix Synapse Notification Emails

matrix-synapse Updated 02 Oct 2025

Summary

26/03/2021
N/A
Yes i
Medium
6.1

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

< 1.27.0-1 < e54746bdf7d5c831eabe4dcea76a7626f1de73df

Fixed in 1.27.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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Matrix Synapse is a reference homeserver for the Matrix protocol, which facilitates open federated Instant Messaging and VoIP. The software is implemented in Python and is widely used for real-time communication. Synapse allows users to send and receive messages, manage accounts, and handle notifications. However, prior to version 1.27.0, it was found to be vulnerable to HTML injection in its notification emails, which could potentially compromise user data and trust.

Vulnerability Detail

The vulnerability arises from improper handling of HTML content in notification emails sent by Synapse for missed messages and expiring accounts. Attackers could exploit this flaw to inject malicious HTML content into the emails, leading to potential phishing attacks or the display of forged information. Although the account expiry feature is not enabled by default, the risk associated with missed message notifications remains significant, as it could mislead users into taking harmful actions.

How To Fix

Minimum fixed version

1.27.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, users can disable notification emails for missed messages until the upgrade is performed. This can be done by modifying the Synapse configuration file (homeserver.yaml) and setting the email notifications to false:

email: enable_notif: false

Conclusion

The HTML injection vulnerability in Matrix Synapse notification emails poses a risk to user security and trust. Upgrading to version 1.27.0 or later is essential to mitigate this risk. Users should also consider disabling email notifications temporarily until the upgrade is complete.

See every vulnerability recorded for matrix-synapse →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 6.1, indicating a medium severity level.

No, the account expiry feature is not enabled by default in Matrix Synapse.

If left unaddressed, this vulnerability could allow attackers to inject malicious content into notification emails, potentially leading to phishing attacks.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Vulert is a tool that monitors and alerts in real-time for open-source vulnerabilities in software using just a manifest file like package-lock.json.

Related vulnerabilities

Recent vulnerabilities recorded for matrix-synapse.

How To Fix

Minimum fixed version

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