{"id":"CVE-2021-21332","aliases":["CVE-2021-21332","GHSA-246w-56m2-5899","PYSEC-2021-133"],"related":[],"kind":"vulnerability","state":"published","title":"Cross-site scripting (XSS) vulnerability in the password reset endpoint","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\nThe 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.\n\n### Patches\nThis is fixed in #9200.\n\n### Workarounds\nDepending on the needs and configuration of the homeserver a few options are available:\n\n1. 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).\n\n2. 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:\n\n    * `/_synapse/client/password_reset/email/submit_token`\n\n3. The `password_reset_confirmation.html` template can be overridden with a custom template that manually escapes the variables using [JInja2's `escape` filter](https://jinja.palletsprojects.com/en/2.11.x/templates/#escape). See the `email.template_dir` setting.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2021-03-26T19:52:54.000Z","modified":"2026-07-08T06:27:41.588Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:N","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:N","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:N","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:L/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N","score":8.2,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 1.27.0","status":"affected"}],"vendor":"matrix-org","product":"synapse","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.27.0"}],"ecosystem":"PyPI","package":"matrix-synapse","purl":"pkg:pypi/matrix-synapse","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.27.0"}],"vendor":"matrix","product":"synapse","cpe":"cpe:2.3:a:matrix:synapse:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"34"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"e54746bdf7d5c831eabe4dcea76a7626f1de73df"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.27.0"}],"ecosystem":"PyPI","package":"matrix-synapse","purl":"pkg:pypi/matrix-synapse","repo":"https://github.com/matrix-org/synapse","source":"pysec"}],"references":[{"url":"https://github.com/matrix-org/synapse/security/advisories/GHSA-246w-56m2-5899","tags":["advisory","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/matrix-org/synapse/releases/tag/v1.27.0","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/matrix-org/synapse/pull/9200","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/matrix-org/synapse/commit/e54746bdf7d5c831eabe4dcea76a7626f1de73df","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TNNAJOZNMVMXM6AS7RFFKB4QLUJ4IFEY/","tags":["vendor-advisory","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21332","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/matrix-org/synapse","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/matrix-synapse/PYSEC-2021-133.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TNNAJOZNMVMXM6AS7RFFKB4QLUJ4IFEY","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-21332","url":"https://www.cve.org/CVERecord?id=CVE-2021-21332","licence":"CVE Terms of Use","modified":"2024-08-03T18:09:15.157Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-246w-56m2-5899","url":"https://github.com/advisories/GHSA-246w-56m2-5899","licence":"CC-BY-4.0","modified":"2026-07-08T06:27:41.588Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-21332","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21332","licence":"Public domain","modified":"2026-06-17T03:35:18.940Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-133","url":"https://osv.dev/vulnerability/PYSEC-2021-133","licence":"CC-BY-4.0","modified":"2023-11-08T04:04:41.638Z"}],"updatedAt":"2026-11-25T22:58:00.469Z","epss":{"score":0.01221,"percentile":0.69537,"date":"2026-12-01T12:00:22.000Z"}}