summary refs log tree commit diff
path: root/synapse/handlers/e2e_keys.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2023-10-31 09:58:30 -0400
committerErik Johnston <erik@matrix.org>2023-10-31 13:59:09 +0000
commitdaec55e1fe120c564240c5386e77941372bf458f (patch)
tree59a102dd37e10981743d959a2cc6aec64990296d /synapse/handlers/e2e_keys.py
parent1.95.0 (diff)
downloadsynapse-daec55e1fe120c564240c5386e77941372bf458f.tar.xz
Merge pull request from GHSA-mp92-3jfm-3575
Diffstat (limited to '')
-rw-r--r--synapse/handlers/e2e_keys.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/handlers/e2e_keys.py b/synapse/handlers/e2e_keys.py
index 8c6432035d..5a0c1f47be 100644
--- a/synapse/handlers/e2e_keys.py
+++ b/synapse/handlers/e2e_keys.py
@@ -542,6 +542,12 @@ class E2eKeysHandler:
         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=(