Synapse vulnerable to leak of remote user device information
Description
Synapse is an open-source Matrix homeserver Prior to versions 1.95.1 and 1.96.0rc1, cached device information of remote users can be queried from Synapse. This can be used to enumerate the remote users known to a homeserver. System administrators are encouraged to upgrade to Synapse 1.95.1 or 1.96.0rc1 to receive a patch. As a workaround, the federation_domain_whitelist can be used to limit federation traffic with a homeserver.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Synapse before 1.95.1/1.96.0rc1 allows remote enumeration of users by querying cached device info of remote users.
Vulnerability
Overview CVE-2023-43796 is an information disclosure vulnerability in Synapse, the open-source Matrix homeserver. The bug allows an attacker to query cached device information for remote users that are not hosted on the target homeserver, enabling user enumeration. The issue exists because the on_federation_query_user_devices and related endpoints did not validate that the queried user belongs to the local homeserver before returning cached data [1][2].
Attack
Vector An attacker can make federation requests to a vulnerable Synapse instance, requesting device keys for arbitrary user IDs. Since the server returns cached device information for any user, including those from other homeservers, the attacker can determine which remote users the homeserver has interacted with or knows about. No authentication is required; the attack is performed over federation protocol [3].
Impact
Successful exploitation allows remote attackers to enumerate the set of remote users known to the homeserver. This information leakage can aid in reconnaissance for further attacks, such as targeting specific users or mapping the social graph of the Matrix network. The vulnerability does not expose private messages or keys, but the enumeration itself is a privacy concern [2][4].
Mitigation
The Synapse project has released patched versions 1.95.1 and 1.96.0rc1. Administrators are strongly advised to upgrade. As a temporary workaround, configuring the federation_domain_whitelist to restrict federation to trusted domains can reduce exposure [1][2].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
matrix-synapsePyPI | < 1.95.1 | 1.95.1 |
Affected products
2- matrix-org/synapsev5Range: < 1.95.1
Patches
1daec55e1fe12Merge pull request from GHSA-mp92-3jfm-3575
3 files changed · +16 −1
synapse/federation/federation_server.py+7 −1 modified@@ -84,7 +84,7 @@ from synapse.storage.databases.main.lock import Lock from synapse.storage.databases.main.roommember import extract_heroes_from_room_summary from synapse.storage.roommember import MemberSummary -from synapse.types import JsonDict, StateMap, get_domain_from_id +from synapse.types import JsonDict, StateMap, get_domain_from_id, UserID from synapse.util import unwrapFirstError from synapse.util.async_helpers import Linearizer, concurrently_execute, gather_results from synapse.util.caches.response_cache import ResponseCache @@ -999,6 +999,12 @@ async def on_query_user_devices( async def on_claim_client_keys( self, query: List[Tuple[str, str, str, int]], always_include_fallback_keys: bool ) -> Dict[str, Any]: + if any( + not self.hs.is_mine(UserID.from_string(user_id)) + for user_id, _, _, _ in query + ): + raise SynapseError(400, "User is not hosted on this homeserver") + log_kv({"message": "Claiming one time keys.", "user, device pairs": query}) results = await self._e2e_keys_handler.claim_local_one_time_keys( query, always_include_fallback_keys=always_include_fallback_keys
synapse/handlers/device.py+3 −0 modified@@ -328,6 +328,9 @@ async def get_user_ids_changed( return result async def on_federation_query_user_devices(self, user_id: str) -> JsonDict: + if not self.hs.is_mine(UserID.from_string(user_id)): + raise SynapseError(400, "User is not hosted on this homeserver") + stream_id, devices = await self.store.get_e2e_device_keys_for_federation_query( user_id )
synapse/handlers/e2e_keys.py+6 −0 modified@@ -542,6 +542,12 @@ async def on_federation_query_client_keys( device_keys_query: Dict[str, Optional[List[str]]] = query_body.get( "device_keys", {} ) + if any( + not self.is_mine(UserID.from_string(user_id)) + for user_id in device_keys_query + ): + raise SynapseError(400, "User is not hosted on this homeserver") + res = await self.query_local_devices( device_keys_query, include_displaynames=(
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
10- github.com/advisories/GHSA-mp92-3jfm-3575ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-43796ghsaADVISORY
- github.com/matrix-org/synapse/commit/daec55e1fe120c564240c5386e77941372bf458fghsax_refsource_MISCWEB
- github.com/matrix-org/synapse/security/advisories/GHSA-mp92-3jfm-3575ghsax_refsource_CONFIRMWEB
- github.com/pypa/advisory-database/tree/main/vulns/matrix-synapse/PYSEC-2023-230.yamlghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2IDEEZMFJBDLTFHQUTZRJJNCOZGQ2ZVSghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VH3RNC5ZPQZ4OKPSL4E6BBJSZOQLGDEYghsaWEB
- security.gentoo.org/glsa/202401-12ghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2IDEEZMFJBDLTFHQUTZRJJNCOZGQ2ZVS/mitre
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VH3RNC5ZPQZ4OKPSL4E6BBJSZOQLGDEY/mitre
News mentions
0No linked articles in our index yet.