synapse
synapse copied to clipboard
Room and group names should be limited to a sensible length
Description
You can set room names and topics to absurdly long strings, which don't fit in a matrix state event. As a result, when you create a room in Element doing so, you get a room with no name/topic as the state event failed to send.
Synapse should fail the /createRoom
call instead immediately instead of creating a room with no name/topic.
There's a similar issue with groups, though while the group is created successfully, being able to create groups with unlimited-length names is not ideal.
We already limit the size of usernames to 512 characters, returning a 400 M_UNKNOWN
. We can do this again for now, but it'd be nice to get an appropriate error code to return so that clients can show a helpful reason as to why creating the room failed. Related spec issue: https://github.com/matrix-org/matrix-doc/issues/1646
Steps to reproduce
- Create a room with a reaaaaaaally long name (>65K chars)
- The
/createRoom
call fails with a 500 - Notice that a room is created anyways
Version information
v1.19.0