summary refs log tree commit diff
path: root/synapse/handlers/presence.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-09-08 15:04:46 +0100
committerErik Johnston <erik@matrix.org>2016-09-08 15:07:38 +0100
commit8b93af662d432cf6b3d36cbbcbd4dd2427bde658 (patch)
tree93b3d737d39697dacd43e222b2dab7d899d432b4 /synapse/handlers/presence.py
parentMerge pull request #1074 from matrix-org/markjh/direct_to_device_federation (diff)
downloadsynapse-8b93af662d432cf6b3d36cbbcbd4dd2427bde658.tar.xz
Check the user_id for presence/typing matches origin
Diffstat (limited to 'synapse/handlers/presence.py')
-rw-r--r--synapse/handlers/presence.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index da9f0da69e..7a3c16a8aa 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -651,6 +651,13 @@ class PresenceHandler(object):
                 )
                 continue
 
+            if get_domain_from_id(user_id) != origin:
+                logger.info(
+                    "Got presence update from %r with bad 'user_id': %r",
+                    origin, user_id,
+                )
+                continue
+
             presence_state = push.get("presence", None)
             if not presence_state:
                 logger.info(