6.1medium
HTML injection in email and account expiry notifications
- Severity
- 6.1medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.35% (higher than 72% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-c5f8-35qr-q4fmPYSEC-2021-134
Description
Synapse is a Matrix reference homeserver written in python (pypi package matrix-synapse). Matrix is an ecosystem for open federated Instant Messaging and VoIP. In Synapse before version 1.27.0, the notification emails sent for notifications for missed messages or for an expiring account are subject to HTML injection. In the case of the notification for missed messages, this could allow an attacker to insert forged content into the email. The account expiry feature is not enabled by default and the HTML injection is not controllable by an attacker. This is fixed in version 1.27.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| matrix-org synapse | < 1.27.0 | CVE List |
| matrix-synapse (PyPI) | before 1.27.0, before e54746bdf7d5c831eabe4dcea76a7626f1de73df | GitHub Advisory Database, PyPA Advisory Database |
| matrix synapse | before 1.27.0 | NVD |
| fedoraproject fedora | 34 | NVD |
All scores
| GitHub_M | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N |
| GitHub | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:N/SI:H/SA:N |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N |
| NVD | 2.6low CVSS:2.0 | AV:N/AC:H/Au:N/C:N/I:P/A:N |
Classification
What each source says
CVE List
Synapse is a Matrix reference homeserver written in python (pypi package matrix-synapse). Matrix is an ecosystem for open federated Instant Messaging and VoIP. In Synapse before version 1.27.0, the notification emails sent for notifications for missed messages or for an expiring account are subject to HTML injection. In the case of the notification for missed messages, this could allow an attacker to insert forged content into the email. The account expiry feature is not enabled by default and the HTML injection is not controllable by an attacker. This is fixed in version 1.27.0.
GitHub Advisory Database
Impact
The notification emails sent for notifications for missed messages or for an expiring account are subject to HTML injection. In the case of the notification for missed messages, this could allow an attacker to insert forged content into the email.
The account expiry feature is not enabled by default and the HTML injection is not controllable by an attacker.
Patches
This issue is fixed in #9200.
Workarounds
For the missed messages notifications:
The notif.html, notif_mail.html, and room.html templates can be overridden with custom templates that manually escapes the variables using JInja2's escape filter. See the email.template_dir setting.
For the account expiry notifications:
-
Account expiry can be disabled via the
account_validity.enabledsetting. -
The
notice_expiry.htmltemplate can be overridden with a custom template that manually escapes the variables using JInja2'sescapefilter. See theemail.template_dirsetting.
NVD (es)
Synapse es un servidor doméstico de referencia de Matrix escrito en python (paquete pypi matrix-synapse). Matrix es un ecosistema para VoIP y mensajería instantánea federada abierta. En Synapse versiones anteriores a 1.27.0, los correos electrónicos de notificación enviados para notificaciones de mensajes perdidos o para una cuenta que vence están sujetos a una inyección de HTML. En el caso de la notificación de mensajes perdidos, esto podría permitir a un atacante insertar contenido forjado en el correo electrónico. La funcionalidad expiry de la cuenta no está habilitada por defecto y la inyección de HTML por un atacante no es controlable . Esto es corregido en la versión 1.27.0.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-21333 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-c5f8-35qr-q4fm changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-21333 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2021-134 changed 2023-11-08 | CC-BY-4.0 |