CVE-2021-21332
JSON

6.9medium

Cross-site scripting (XSS) vulnerability in the password reset endpoint

Severity
6.9medium CVSS:3.1 by GitHub_M
Exploit likelihood
1.22% (higher than 69% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-246w-56m2-5899PYSEC-2021-133

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 password reset endpoint served via Synapse was vulnerable to cross-site scripting (XSS) attacks. The impact depends on the configuration of the domain that Synapse is deployed on, but may allow access to cookies and other browser data, CSRF vulnerabilities, and access to other resources served on the same domain or parent domains. This is fixed in version 1.27.0.

Affected

Product or packageVersionsReported by
matrix-org synapse< 1.27.0CVE List
matrix-synapse (PyPI)before 1.27.0, before e54746bdf7d5c831eabe4dcea76a7626f1de73dfGitHub Advisory Database, PyPA Advisory Database
matrix synapsebefore 1.27.0NVD
fedoraproject fedora34NVD

All scores

GitHub_M6.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:N
GitHub6.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:L/SA:N
NVD8.2high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
NVD4.3medium CVSS:2.0AV:N/AC:M/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 password reset endpoint served via Synapse was vulnerable to cross-site scripting (XSS) attacks. The impact depends on the configuration of the domain that Synapse is deployed on, but may allow access to cookies and other browser data, CSRF vulnerabilities, and access to other resources served on the same domain or parent domains. This is fixed in version 1.27.0.

GitHub Advisory Database
Impact

The password reset endpoint served via Synapse was vulnerable to cross-site scripting (XSS) attacks. The impact depends on the configuration of the domain that Synapse is deployed on, but may allow access to cookies and other browser data, CSRF vulnerabilities, and access to other resources served on the same domain or parent domains.

Patches

This is fixed in #9200.

Workarounds

Depending on the needs and configuration of the homeserver a few options are available:

  1. Password resets can be disabled by delegating email to a third-party service (via the account_threepid_delegates.email setting) or disabling email (by not configuring the email setting).

  2. If the homeserver is not configured to use passwords (via the password_config.enabled setting) then the affected endpoint can be blocked at a reverse proxy:

    • /_synapse/client/password_reset/email/submit_token
  3. The password_reset_confirmation.html template can be overridden with a custom template that manually escapes the variables using JInja2's escape filter. See the email.template_dir setting.

NVD (es)

Synapse es un servidor doméstico de referencia de Matrix escrito en python (paquete pypi matrix-synapse).&#xa0;Matrix es un ecosistema para VoIP y mensajería instantánea federada abierta.&#xa0;En Synapse versiones anteriores a 1.27.0, el endpoint de restablecimiento de contraseña servido por medio de Synapse era vulnerable a ataques de tipo cross-site scripting (XSS).&#xa0;El impacto depende de la configuración del dominio en el que es implementado Synapse, pero puede permitir el acceso a cookies y otros datos del navegador, vulnerabilidades de tipo CSRF y acceso a otros recursos que se encuentran en el mismo dominio o dominios principales.&#xa0;Esto es corregido en la versión 1.27.0.

References

https://github.com/matrix-org/synapse/security/advisories/GHSA-246w-56m2-5899advisory, third-party-advisory, web
https://github.com/matrix-org/synapse/releases/tag/v1.27.0third-party-advisory, web
https://github.com/matrix-org/synapse/pull/9200patch, third-party-advisory, web
https://github.com/matrix-org/synapse/commit/e54746bdf7d5c831eabe4dcea76a7626f1de73dffix, patch, third-party-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TNNAJOZNMVMXM6AS7RFFKB4QLUJ4IFEY/vendor-advisory
https://nvd.nist.gov/vuln/detail/CVE-2021-21332advisory
https://github.com/matrix-org/synapsepackage
https://github.com/pypa/advisory-database/tree/main/vulns/matrix-synapse/PYSEC-2021-133.yamlweb
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TNNAJOZNMVMXM6AS7RFFKB4QLUJ4IFEYweb

Sources

SourceRecordLicence
CVE ListCVE-2021-21332 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-246w-56m2-5899 changed 2026-07-08CC-BY-4.0
NVDCVE-2021-21332 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2021-133 changed 2023-11-08CC-BY-4.0