Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Enforce state key matches sender
Browse files Browse the repository at this point in the history
  • Loading branch information
neilalexander committed Jan 4, 2022
1 parent 85ede6d commit e6be7f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions federationapi/routing/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ func SendJoin(
JSON: jsonerror.BadJSON("No state key was provided in the join event."),
}
}
if !event.StateKeyEquals(event.Sender()) {
return util.JSONResponse{
Code: http.StatusBadRequest,
JSON: jsonerror.BadJSON("Event state key must match the event sender."),
}
}

// Check that the room ID is correct.
if event.RoomID() != roomID {
Expand Down

0 comments on commit e6be7f0

Please sign in to comment.