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
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
f94b807f39
Коммит
fa80cb10a8
@@ -2808,7 +2808,10 @@ func (c *Client4) ListCommands(teamId string, customOnly bool) ([]*Command, *Res
|
||||
|
||||
// ExecuteCommand executes a given command.
|
||||
func (c *Client4) ExecuteCommand(channelId, command string) (*CommandResponse, *Response) {
|
||||
commandArgs := &CommandArgs{ChannelId: channelId, Command: command}
|
||||
commandArgs := &CommandArgs{
|
||||
ChannelId: channelId,
|
||||
Command: command,
|
||||
}
|
||||
if r, err := c.DoApiPost(c.GetCommandsRoute()+"/execute", commandArgs.ToJson()); err != nil {
|
||||
return nil, BuildErrorResponse(r, err)
|
||||
} else {
|
||||
|
||||
Ссылка в новой задаче
Block a user