-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
synapse checks signature on join_authorised_via_users_server
in m.room.membership
events for room versions which do not specify it
#10923
Comments
cc @clokep Synapse also does the signature check if |
There's a few spots I think you might be referring to:
I don't see any of these meeting the requirements in the description, could you point to which of these (or maybe I missed a spot!) that you were taking a look at?
The comment was added in #10393, I might have a flawed understanding of what this code is doing (or might have over-simplified for the comment). |
Sorry! This one:
right, but it still checks it is there, which is a new requirement which existing servers would not apply - hence the danger of split-braining where some servers accept, and some reject, the event. But now that you point out the other places, I have another opinion :/
The implementation here looks sound, though:
well yes, therein lies the rub. I was mostly worrying about the calls from I would say: we should update the docstring on |
This should be checking the room versions, I think this is what you're filing this issue about?
If you have thoughts on an updated comment I'd really appreciate it! I added it while trying to figure out how all this works and I probably don't have a full underestanding!
I think @erikjohnston said that this was for (a) speed, and (b) because a signature could become invalid after it was accepted due to a server changing their keys, so you don't want to constantly check them. They should be accepted or not once.
It sounds like this is a minor implementation bug (which I'll fix shortly!), but I don't think the proper implementation is different than the spec?
This sounds like my understanding of why this flag exists (b) from above. |
As an example: we currently check the signature irrespective of the current membership of the user, and will reject any incorrectly-signed events, even if they represent join->join transitions. That is not what matrix-org/matrix-spec-proposals#3387 says at present, hence my thread at matrix-org/matrix-spec-proposals#3387 (comment). I don't know if there are other examples, but I'm really asking for your help in making sure that we have an exact match between the spec and the implementation. |
This is pretty much #10920 which I'm working on now! |
@richvdh I'm not 100% sure this is "fixed", but I think the initial technical big is fixed! |
As of room v8 and later, an extra auth rule is added which says that the event must be signed by the server given in
join_authorised_via_users_server
. However, synapse also applies that to check to old room versions, and to membership events other than joins. Since spec-compliant implementations will not perform the check in those instances, this could lead to spilt-brained rooms.The text was updated successfully, but these errors were encountered: