summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorwerner291 <werner.kroneman@gmail.com>2019-10-10 14:05:48 +0200
committerRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-10-10 13:05:48 +0100
commitb5b03b7079a9baa34a25915d6a569e383e8307c3 (patch)
tree60fb63809bc9cd861b9d3a227dfd025fb65b4e02 /synapse/handlers
parentbefore fulfilling a group invite,check if user is already joined/invited (#3436) (diff)
downloadsynapse-b5b03b7079a9baa34a25915d6a569e383e8307c3.tar.xz
Add domain validation when creating room with list of invitees (#6121)
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/room.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 970be3c846..2816bd8f87 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -28,6 +28,7 @@ from twisted.internet import defer
 from synapse.api.constants import EventTypes, JoinRules, RoomCreationPreset
 from synapse.api.errors import AuthError, Codes, NotFoundError, StoreError, SynapseError
 from synapse.api.room_versions import KNOWN_ROOM_VERSIONS
+from synapse.http.endpoint import parse_and_validate_server_name
 from synapse.storage.state import StateFilter
 from synapse.types import RoomAlias, RoomID, RoomStreamToken, StreamToken, UserID
 from synapse.util import stringutils
@@ -554,7 +555,8 @@ class RoomCreationHandler(BaseHandler):
         invite_list = config.get("invite", [])
         for i in invite_list:
             try:
-                UserID.from_string(i)
+                uid = UserID.from_string(i)
+                parse_and_validate_server_name(uid.domain)
             except Exception:
                 raise SynapseError(400, "Invalid user_id: %s" % (i,))