URL previews of unusual or maliciously-crafted pages can crash Synapse media repositories or Synapse monoliths
Impact
URL previews of some web pages can exhaust the available stack space for the Synapse process due to unbounded recursion. This is sometimes recoverable and leads to an error for the request causing the problem, but in other cases the Synapse process may crash altogether.
It is possible to exploit this maliciously, either by malicious users on the homeserver, or by remote users sending URLs that a local user's client may automatically request a URL preview for. Remote users are not able to exploit this directly, because the URL preview endpoint is authenticated.
Am I affected?
- deployments with
url_preview_enabled: falseset in configuration are not affected. - deployments with
url_preview_enabled: trueset in configuration are affected. - deployments with no configuration value set for
url_preview_enabledare not affected, because the default isfalse.
Patches
Administrators of homeservers with URL previews enabled are advised to upgrade to v1.61.1 or higher.
Workarounds
- URL previews can be disabled in the configuration file by setting
url_preview_enabled: false. - Deployments using workers can choose to offload URL previews to one or more dedicated worker(s), ensuring that a process crash does not disrupt other functionality of Synapse.
For more information
If you have any questions or comments about this advisory, e-mail us at security@matrix.org.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | matrix-synapse | < 1.61.1 | 1.61.1 |
References
- https://github.com/matrix-org/synapse/security/advisories/GHSA-22p3-qrh9-cx32
- https://spec.matrix.org/v1.2/client-server-api/#get_matrixmediav3preview_url
- https://github.com/matrix-org/synapse/commit/fa1308061802ac7b7d20e954ba7372c5ac292333
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QGSDQ4YAITCUACAB7SXQZDJIU3IQ4CJD/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7EARKKJZ2W7WUITFDT4EG4NVATFYJQHF/
- https://nvd.nist.gov/vuln/detail/CVE-2022-31052
- https://github.com/matrix-org/synapse
- https://github.com/pypa/advisory-database/tree/main/vulns/matrix-synapse/PYSEC-2022-224.yaml
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7EARKKJZ2W7WUITFDT4EG4NVATFYJQHF
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QGSDQ4YAITCUACAB7SXQZDJIU3IQ4CJD
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H- Weakness (CWE)
CWE-674- Platform
- Python (PyPI)
- Package
matrix-synapse- Disclosed
- 28.06.2022
- Updated
- 11.10.2026 11:20
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2022-224 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-22p3-qrh9-cx32 - CC BY 4.0
Vulnerability history: matrix-synapse
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 45
- First → latest
- 03.2019 05.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 21
- Medium 21
- Low 3
Disclosures per year
- 2019: 3
- 2020: 3
- 2021: 12
- 2022: 7
- 2023: 9
- 2024: 7
- 2025: 2
- 2026: 2
-
URL previews of unusual or maliciously-crafted pages can crash Synapse media repositories or Synapse monoliths this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.