CVE-2022-41952: Matrix synapse Remote Code Execution Vulnerability
MODERATECVE-2022-41952 is a MODERATE (CVSS 5.3) remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Matrix synapse libraries in the PyPI ecosystem. The issue involves uncontrolled resource consumption in matrix synapse. Remediation is available by upgrading affected packages to version 1.53.0.
CVE-2022-41952 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).
How to Fix CVE-2022-41952
To remediate this vulnerability, upgrade all affected Matrix synapse dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install matrix-synapse>=1.53.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show matrix-synapse
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-41952, inspect your installed packages using pip:
pip show matrix-synapse
Analyze the terminal output to locate any version of Matrix synapse in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.53.0), your application is affected.
Note: The pip show matrix-synapse command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Matrix synapse, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-41952 Affected Matrix synapse Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
matrix-synapse
|
PyPI |
< 1.53.0
|
1.53.0
|
References
Frequently Asked Questions
What is CVE-2022-41952?
Which Matrix synapse versions are affected?
What version fixes CVE-2022-41952?
Is matrix-synapse affected?
What is the CVSS score of CVE-2022-41952?
What CWE is associated with CVE-2022-41952?
How can I check PyPI dependencies for CVE-2022-41952?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4822-jvwx-w47h",
"modified" : "2022-11-28T16:18:30Z",
"published" : "2022-04-01T18:16:42Z",
"aliases" : [ "CVE-2022-41952" ],
"summary" : "Uncontrolled Resource Consumption in Matrix Synapse",
"details" : "### Impact\n\nSynapse before 1.52.0 with URL preview functionality enabled will attempt to generate URL previews for media stream URLs without properly limiting connection time. Connections will only be terminated after `max_spider_size` (default: 10M) bytes have been downloaded, which can in some cases lead to long-lived connections towards the streaming media server (for instance, Icecast).\n\nThis can cause excessive traffic and connections toward such servers if their stream URL is, for example, posted to a large room with many Synapse instances with URL preview enabled.\n\n### Patches\n1.52.0 implements a timeout mechanism which will terminate URL preview connections after 30 seconds. Since generating URL previews for media streams is not supported and always fails, 1.53.0 additionally implements an allow list for content types for which Synapse will even attempt to generate a URL preview.\n\nWe recommend upgrading to 1.53.0 to fully resolve the issue.\n\n### Workarounds\nTurn off URL preview functionality by setting `url_preview_enabled: false` in the Synapse configuration file.\n\n### References\n- Patch (timeout): https://github.com/matrix-org/synapse/pull/11784\n- Patch (content type allow list): https://github.com/matrix-org/synapse/pull/11936\n\n### For more information\nIf you have any questions or comments about this advisory, e-mail us at security@matrix.org.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "matrix-synapse"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.53.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/matrix-org/synapse/security/advisories/GHSA-4822-jvwx-w47h"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-41952"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/synapse/pull/11784"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/synapse/pull/11936"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/matrix-org/synapse"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/synapse/releases/tag/v1.52.0"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/synapse/releases/tag/v1.53.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400", "CWE-772" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-04-01T18:16:42Z",
"nvd_published_at" : "2022-11-22T16:15:00Z"
}
}