-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
A m.room.power_levels
state event was accepted with newlines in user IDs
#10715
Comments
The spec says in Checks performed on receipt of a PDU that the event has to be valid. But "valid" is not properly defined in the spec, also see https://github.com/matrix-org/matrix-doc/issues/1646 |
It's (arguably) a bug in Synapse that it accepted this event over the C-S api, but also Ruma needs to accept it over federation anyway, for compatibility with older/other homeservers. |
It's the servername validation that errors here. The PDU will be kept in its original form anyways, but would it make more sense for compatibility to "fix" the ID by removing the trailing newline (i.e. when checking power levels, have |
not. You should only apply PLs when the user id matches exactly. For the same reason, you should also not apply
The situation is clear here. We cannot strengthen the rules in what constitutes an "acceptable" |
Just remembered that we were recently talking about event validation in one of the ruma rooms and I re-realized that the strong types from ruma-events aren't really feasible for validating events over federation anyways. Overall, I think it is very much warranted to not have this event supported "natively" in Ruma. Conduit will have to do its validation differently anyways, and clients built using Ruma might as well fail to recognize this event for all I care. I'm not willing to build in a workaround for this unless it affects lots of rooms and/or is very hard to fix. |
To summarise my understanding of this issue: Synapse is defective in that it accepts these events from local clients, but accepting them from over federation is unfortunately correct. |
Description
Synapse is accepting
m.room.power_levels
state events with the following content;Ruma trips on this content, because it expects fully well-formed User IDs, and so rejects parsing this kind of event.
The spec says not much of substance regarding validating these user IDs.
Note: Event has been partially redacted to keep community privacy, i can provide more info and the corresponding room via DMs to synapse devs.
Version information
Own homeserver version (atm): 1.40.0
Their homeserver version (atm): 1.40.0
The text was updated successfully, but these errors were encountered: