PLT-7785: Slash commands can be issued to a channel in a team without it (#7567)

* Ensured that specified channel is a part of specified team

* Simplified approach to just infer team id from specified channel id to eliminate the attack vector entirely
Этот коммит содержится в:
Jonathan
2017-10-04 11:12:13 -04:00
коммит произвёл Christopher Speller
родитель f94b807f39
Коммит fa80cb10a8
3 изменённых файлов: 42 добавлений и 7 удалений

Просмотреть файл

@@ -212,12 +212,9 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
if commandArgs.TeamId == "" {
commandArgs.TeamId = channel.TeamId
} else if c.Session.GetTeamByTeamId(commandArgs.TeamId) == nil {
c.SetPermissionError(model.PERMISSION_USE_SLASH_COMMANDS)
return
}
// team id is implicitly taken from channel so that slash commands
// created on some other team can't be run against this one
commandArgs.TeamId = channel.TeamId
commandArgs.UserId = c.Session.UserId
commandArgs.T = c.T