Check user belongs to remote when updating profile image (#27008)

Этот коммит содержится в:
Doug Lauder
2024-05-16 08:21:12 -04:00
коммит произвёл GitHub
родитель 9559fa6486
Коммит 5a79565244

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

@@ -271,6 +271,15 @@ func remoteSetProfileImage(c *Context, w http.ResponseWriter, r *http.Request) {
c.SetInvalidURLParam("user_id")
return
}
// ensure the user being modified belongs to the remote requesting the change.
requesterRemoteID := c.GetRemoteID(r)
if user.GetRemoteID() != requesterRemoteID {
c.Err = model.NewAppError("remoteSetProfileImage", "api.context.remote_id_mismatch.app_error",
nil, "", http.StatusUnauthorized)
return
}
audit.AddEventParameterAuditable(auditRec, "user", user)
imageData := imageArray[0]