summary refs log tree commit diff
path: root/synapse/handlers/room.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-02-26 12:33:59 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-02-26 12:33:59 +0000
commit846f1c0593e08ce2d880e9314a69aeb86b8b2eb5 (patch)
tree6e40f8cd3fcfabd9050dae424ea46f574936e26d /synapse/handlers/room.py
parentbefore fulfilling a group invite,check if user is already joined/invited (#3436) (diff)
parentAdd domain validation when creating room with list of invitees (#6121) (diff)
downloadsynapse-846f1c0593e08ce2d880e9314a69aeb86b8b2eb5.tar.xz
Add domain validation when creating room with list of invitees (#6121)
Diffstat (limited to 'synapse/handlers/room.py')
-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 3e815d7d46..a3ada4f656 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
@@ -573,7 +574,8 @@ class RoomCreationHandler(BaseHandler):
 
         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,))