From a6c364822a9d64d416ca5868502ac32a7eb94435 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Tue, 31 Jul 2018 19:13:44 +0100 Subject: MM-11516: Check channel ID in URL param and Body are same. (#9185) --- api4/channel.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'api4') diff --git a/api4/channel.go b/api4/channel.go index 0b8470975..f21b45d56 100644 --- a/api4/channel.go +++ b/api4/channel.go @@ -90,6 +90,12 @@ func updateChannel(c *Context, w http.ResponseWriter, r *http.Request) { return } + // The channel being updated in the payload must be the same one as indicated in the URL. + if channel.Id != c.Params.ChannelId { + c.SetInvalidParam("channel_id") + return + } + var oldChannel *model.Channel var err *model.AppError if oldChannel, err = c.App.GetChannel(channel.Id); err != nil { -- cgit v1.2.3-1-g7c22